Show / Hide Table of Contents

Struct MemoryMappedDirectAccessor

Provides direct access to the memory-mapped file content through pointer to its virtual memory.

Implements
IUnmanagedMemory
IDisposable
Namespace: DotNext.IO.MemoryMappedFiles
Assembly: DotNext.Unsafe.dll
Syntax
public struct MemoryMappedDirectAccessor : IUnmanagedMemory, IDisposable

Properties

| Improve this Doc View Source

Bytes

Represents memory-mapped file segment in the form of .

Declaration
public Span<byte> Bytes { get; }
Property Value
Type Description
Span<Byte>

representing virtual memory of the mapped file segment.

| Improve this Doc View Source

IsEmpty

Gets a value indicating that this object doesn't represent the memory-mapped file segment.

Declaration
public bool IsEmpty { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

Offset

Gets the number of bytes by which the starting position of this segment is offset from the beginning of the memory-mapped file.

Declaration
public long Offset { get; }
Property Value
Type Description
Int64
| Improve this Doc View Source

Pointer

Gets pointer to the virtual memory of the mapped file.

Declaration
public Pointer<byte> Pointer { get; }
Property Value
Type Description
Pointer<Byte>

The pointer to the memory-mapped file.

| Improve this Doc View Source

Size

Gets length of the mapped segment.

Declaration
public long Size { get; }
Property Value
Type Description
Int64

Methods

| Improve this Doc View Source

AsStream()

Converts the segment of the memory-mapped file

Declaration
public Stream AsStream()
Returns
Type Description
Stream

The stream representing virtual memory of the memory-mapped file.

Remarks

The caller is responsible for disposing of the returned stream.

| Improve this Doc View Source

Clear()

Sets all bits of allocated memory to zero.

Declaration
public void Clear()
| Improve this Doc View Source

Dispose()

Releases virtual memory associated with the mapped file segment.

Declaration
public void Dispose()
| Improve this Doc View Source

Flush()

Clears all buffers for this view and causes any buffered data to be written to the underlying file.

Declaration
public void Flush()

Implements

IUnmanagedMemory
IDisposable

Extension Methods

ExpressionBuilder.Const<T>(T)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX