Class MappedAccessorInt16
A memory mapped accessor that stores shorts.
Inherited Members
Namespace: Mars.Common.IO.Mapped.Accessors
Assembly: Mars.IO.dll
Syntax
public sealed class MappedAccessorInt16 : MappedAccessor<short>
Constructors
MappedAccessorInt16(MemoryMap, Stream)
Creates a new memory mapped file.
Declaration
public MappedAccessorInt16(MemoryMap file, Stream stream)
Parameters
Type | Name | Description |
---|---|---|
MemoryMap | file | |
Stream | stream |
Methods
ReadArray(Int64, Int16[], Int32, Int32)
Reads elements starting at the given position.
Declaration
public override int ReadArray(long position, short[] array, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | position | |
System.Int16[] | array | |
System.Int32 | offset | |
System.Int32 | count |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
Mars.Common.IO.Mapped.MappedAccessor<System.Int16>.ReadArray(System.Int64, System.Int16[], System.Int32, System.Int32)
ReadFrom(Stream, Int64, ref Int16)
Reads appropriate amount of bytes from the stream at the given position and returns the structure.
Declaration
public override long ReadFrom(Stream stream, long position, ref short structure)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | |
System.Int64 | position | |
System.Int16 | structure |
Returns
Type | Description |
---|---|
System.Int64 |
Overrides
Mars.Common.IO.Mapped.MappedAccessor<System.Int16>.ReadFrom(Stream, System.Int64, System.Int16)
WriteArray(Int64, Int16[], Int32, Int32)
Writes an array of elements at the given position.
Declaration
public override long WriteArray(long position, short[] array, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | position | |
System.Int16[] | array | |
System.Int32 | offset | |
System.Int32 | count |
Returns
Type | Description |
---|---|
System.Int64 |
Overrides
Mars.Common.IO.Mapped.MappedAccessor<System.Int16>.WriteArray(System.Int64, System.Int16[], System.Int32, System.Int32)
WriteTo(Stream, Int64, ref Int16)
Converts the structure to bytes and writes them to the stream.
Declaration
public override long WriteTo(Stream stream, long position, ref short structure)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | |
System.Int64 | position | |
System.Int16 | structure |
Returns
Type | Description |
---|---|
System.Int64 |
Overrides
Mars.Common.IO.Mapped.MappedAccessor<System.Int16>.WriteTo(Stream, System.Int64, System.Int16)