|   | BlockAllocatedMemoryStreamToArray Method | 
        
        
            Writes the stream contents to a byte array, regardless of the 
Position property.
            
 GSF.Core (in GSF.Core.dll) Version: 2.4.257-beta+00aa2366fbb9ec75f636ebc7cfa610e3826a727c
 Syntax
SyntaxPublic Function ToArray As Byte()
public:
array<unsigned char>^ ToArray()
member ToArray : unit -> byte[] 
Return Value
ByteA 
Byte[] containing the current data in the stream
 Exceptions
Exceptions| Exception | Condition | 
|---|
| InvalidOperationException | Cannot create a byte array with more than 2,147,483,591 elements. | 
| ObjectDisposedException | The stream is closed. | 
 Remarks
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
See Also