MemoryStream

constructor()

Initializes a new instance of the MemoryStream class with an expandable capacity initialized to zero.


constructor(capacity: Int)

Initializes a new instance of the MemoryStream class with an expandable capacity initialized as specified.

Parameters

capacity

The initial size of the internal array in bytes.


constructor(buffer: Array<Byte>)

Initializes a new non-resizable instance of the MemoryStream class based on the specified byte array.

Parameters

buffer

The array of unsigned bytes from which to create the current stream.


constructor(buffer: Array<Byte>, writable: Boolean)

Initializes a new non-resizable instance of the MemoryStream class based on the specified byte array, with writable set as specified.

Parameters

buffer

The array of unsigned bytes from which to create this stream.

writable

True if the stream supports writing, false otherwise.


constructor(buffer: Array<Byte>, index: Int, count: Int)

Initializes a new non-resizable instance of the MemoryStream class based on the specified region of a byte array.

Parameters

buffer

The array of unsigned bytes from which to create this stream.

index

The index into buffer at which the stream begins.

count

The length of the stream in bytes.


constructor(buffer: Array<Byte>, index: Int, count: Int, writable: Boolean)

Initializes a new non-resizable instance of the MemoryStream class based on the specified region of a byte array, with writable set as specified.

Parameters

buffer

The array of unsigned bytes from which to create this stream.

index

The index into buffer at which the stream begins.

count

The length of the stream in bytes.

writable

True if the stream supports writing, false otherwise.


constructor(buffer: Array<Byte>, index: Int, count: Int, writable: Boolean, publiclyVisible: Boolean)

Initializes a new instance of the MemoryStream class based on the specified region of a byte array, with writable set as specified, and publiclyVisible set as specified.

Parameters

buffer

The array of unsigned bytes from which to create this stream.

index

The index into buffer at which the stream begins.

count

The length of the stream in bytes.

writable

Whether the stream supports writing.

publiclyVisible

Whether the stream allows direct access to the underlying buffer.