Reads data from a stream until the end is reached. The data is returned as a byte array. An IOException is thrown if any of the underlying IO calls fail.

Namespace: MonoSoftware.Core
Assembly: MonoSoftware.Core (in MonoSoftware.Core.dll) Version: 1.0.40.669 (1.0.40.669)

Syntax

C#
public static byte[] ReadToEnd(
	this Stream stream,
	int initialLength
)
Visual Basic
<ExtensionAttribute> 
Public Shared Function ReadToEnd ( 
	stream As Stream,
	initialLength As Integer
) As Byte()
Visual C++
public:
[ExtensionAttribute]
static array<unsigned char>^ ReadToEnd(
	Stream^ stream, 
	int initialLength
)
F#
static member ReadToEnd : 
        stream : Stream * 
        initialLength : int -> byte[] 

Parameters

stream
Type: System.IO..::..Stream
The stream to read data from
initialLength
Type: System..::..Int32
The initial buffer length

Return Value

Type: array<Byte>[]()[][]

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 Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also