BlockAllocatedMemoryStreamToArray Method

Writes the stream contents to a byte array, regardless of the Position property.

Definition

Namespace: Gemstone.IO
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
public byte[] ToArray()

Return Value

Byte
A Byte[] containing the current data in the stream

Remarks

This may fail if there is not enough contiguous memory available to hold current size of stream. When possible use methods which operate on streams directly instead.

Exceptions

InvalidOperationExceptionCannot create a byte array with more than 2,147,483,591 elements.
ObjectDisposedExceptionThe stream is closed.

See Also