Mono Class Library: System.IO.MemoryStream Overview | Members

System.IO.MemoryStream.ToArray Method

Writes the entire stream contents to a byte array, regardless of the current position within the stream. [Edit]

public virtual byte[] ToArray ()

Returns

A new byte array. [Edit]

Remarks

This method returns a copy of the contents of the System.IO.MemoryStream as a byte array. If the current instance was constructed on a provided byte array, a copy of the section of the array to which the current instance has access is returned.

Note: For additional information, see the System.IO.MemoryStream (byte[], int, int ) constructor.

Note: This method works when the System.IO.MemoryStream is closed.

Operation
As described above.

[Edit]

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0