Class MappedAccessorVariable<T>
A memory mapped accessor that stores objects of a variable size in bytes.
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Mars.Common.IO.Mapped.Accessors
Assembly: Mars.IO.dll
Syntax
public sealed class MappedAccessorVariable<T> : MappedAccessor<T>, IDisposable
Type Parameters
Name | Description |
---|---|
T |
Constructors
| Improve this Doc View SourceMappedAccessorVariable(MemoryMap, Stream, MemoryMap.ReadFromDelegate<T>, MemoryMap.WriteToDelegate<T>)
Creates a new memory mapped file.
Declaration
public MappedAccessorVariable(MemoryMap file, Stream stream, MemoryMap.ReadFromDelegate<T> readFrom, MemoryMap.WriteToDelegate<T> writeTo)
Parameters
Type | Name | Description |
---|---|---|
MemoryMap | file | |
System.IO.Stream | stream | |
MemoryMap.ReadFromDelegate<T> | readFrom | |
MemoryMap.WriteToDelegate<T> | writeTo |
Methods
| Improve this Doc View SourceReadFrom(Stream, Int64, ref T)
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 T structure)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | |
System.Int64 | position | |
T | structure |
Returns
Type | Description |
---|---|
System.Int64 |
Overrides
Mars.Common.IO.Mapped.MappedAccessor<T>.ReadFrom(System.IO.Stream, System.Int64, T)
|
Improve this Doc
View Source
WriteTo(Stream, Int64, ref T)
Converts the structure to bytes and writes them to the stream.
Declaration
public override long WriteTo(Stream stream, long position, ref T structure)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | |
System.Int64 | position | |
T | structure |
Returns
Type | Description |
---|---|
System.Int64 |
Overrides
Mars.Common.IO.Mapped.MappedAccessor<T>.WriteTo(System.IO.Stream, System.Int64, T)
Implements
System.IDisposable