Click or drag to resize

BlockAllocatedMemoryStreamToArray Method

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

Namespace: GSF.IO
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax
public byte[] ToArray()
View Source

Return Value

Byte
A Byte[] containing the current data in the stream
Exceptions
ExceptionCondition
InvalidOperationExceptionCannot create a byte array with more than 2,147,483,591 elements.
ObjectDisposedExceptionThe stream is closed.
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.
See Also