MtMemoryStream

Namespace: SharpPluginLoader.Core.IO

Represents a memory stream.

public class MtMemoryStream : MtStream, System.IDisposable

Inheritance ObjectNativeWrapperMtObjectMtStreamMtMemoryStream
Implements IDisposable

Properties

Buffer

The buffer of this memory stream.

public nint Buffer { get; }

Property Value

IntPtr

IsBufferOverflowed

Whether this memory stream is overflowed.

public bool IsBufferOverflowed { get; }

Property Value

Boolean

Mode

Gets the mode this memory stream was created with.

public MemoryStreamMode Mode { get; }

Property Value

MemoryStreamMode

Flags

The flags of the stream.

public UInt32& Flags { get; }

Property Value

UInt32&

IsReadable

Whether the stream is readable.

public bool IsReadable { get; }

Property Value

Boolean

IsWritable

Whether the stream is writable.

public bool IsWritable { get; }

Property Value

Boolean

IsSeekable

Whether the stream is seekable.

public bool IsSeekable { get; }

Property Value

Boolean

Position

Gets the position of the stream.

public long Position { get; }

Property Value

Int64

Length

Gets or sets the length of the stream.

public long Length { get; set; }

Property Value

Int64

Instance

The native pointer.

public nint Instance { get; set; }

Property Value

IntPtr

Constructors

MtMemoryStream(IntPtr)

public MtMemoryStream(nint instance)

Parameters

instance IntPtr

MtMemoryStream()

public MtMemoryStream()

Methods

Create()

Creates a new expandable memory stream.

public static MtMemoryStream Create()

Returns

MtMemoryStream
The new memory stream or null if it could not be created.

Create(Byte[])

Creates a new memory stream from the specified buffer.

public static MtMemoryStream Create(Byte[] buffer)

Parameters

buffer Byte[]
The buffer to use

Returns

MtMemoryStream
The new memory stream or null if it could not be created.

Remarks:

Note that the memory stream returned by this method is not expandable. It also does not take ownership of the buffer.

Dispose()

public void Dispose()

Finalize()

protected void Finalize()