Writes the entire stream contents to a byte array, regardless of the Position property.
[Visual Basic] Overridable Public Function ToArray() As Byte () [C#] public virtual byte[] ToArray(); [C++] public: virtual unsigned char* ToArray() []; [JScript] public function ToArray() : Byte[];
A new byte array.
Exception Type | Condition |
---|---|
ArgumentException | The stream is closed. |
MemoryStream Class | MemoryStream Members | System.IO Namespace