Click or drag to resize

ExtensionsReadToEnd Method (Stream, Encoding)

Reads all characters from the current position to the end of the stream.

Namespace:  Cauldron
Assembly:  Cauldron (in Cauldron.dll) Version: 3.2.0.1 (3.2.0.1)
Syntax
C#
public static string ReadToEnd(
	this Stream stream,
	Encoding encoding
)

Parameters

stream
Type: System.IOStream
The stream to read
encoding
Type: System.TextEncoding
The character encoding to use.

Return Value

Type: String
The rest of the stream as a string, from the current position to the end. If the current position is at the end of the stream, returns an empty string ("").

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).
Exceptions
ExceptionCondition
OutOfMemoryException There is insufficient memory to allocate a buffer for the returned string.
IOExceptionAn I/O error occurs.
See Also