Copies the entire contents of specified stream to a new memory stream.

Namespace: FirstFloor.Documents.IO
Assembly: FirstFloor.Documents (in FirstFloor.Documents.dll) Version: 2.5.0.0 (2.5.1.0)

Syntax

C#
public static MemoryStream ToMemoryStream(
	this Stream stream,
	int bufferSize
)
Visual Basic
<ExtensionAttribute> _
Public Shared Function ToMemoryStream ( _
	stream As Stream, _
	bufferSize As Integer _
) As MemoryStream
Visual C++
[ExtensionAttribute]
public:
static MemoryStream^ ToMemoryStream(
	Stream^ stream, 
	int bufferSize
)

Parameters

stream
Type: System.IO..::..Stream
The stream.
bufferSize
Type: System..::..Int32
Size of the buffer.

Return Value

The memory stream.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Stream. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .

See Also