BlockAllocatedMemoryStream(Byte, Int32, Int32) Constructor

Initializes a new instance of BlockAllocatedMemoryStream from specified region of buffer.

Definition

Namespace: Gemstone.IO
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.136 -- Release Build+d454dafd53fcce88fce9c0a8ec8597176c30b791
public BlockAllocatedMemoryStream(
	byte[] buffer,
	int startIndex,
	int length
)

Parameters

buffer  Byte
Initial buffer to copy into stream.
startIndex  Int32
0-based start index into the buffer.
length  Int32
Valid number of bytes within buffer from startIndex.

Remarks

Unlike MemoryStream, the BlockAllocatedMemoryStream will not use the provided buffer as its backing buffer. The buffer will be copied into internally managed reusable memory buffers. Subsequently, the notion of a non-expandable stream is not supported.

Exceptions

ArgumentNullExceptionbuffer is null.
ArgumentOutOfRangeExceptionstartIndex or length is less than 0 -or- startIndex and length will exceed buffer length.

See Also