C# Class Simple.StreamExtensions

Show file Open project: juanplopes/simple

Public Methods

Method Description
ToByteArray ( this stream, int initialLength ) : byte[]

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.

ToStream ( this str ) : StringStream
ToStream ( this str, Encoding encoding ) : StringStream

Method Details

ToByteArray() public static method

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.
public static ToByteArray ( this stream, int initialLength ) : byte[]
stream this The stream to read data from
initialLength int The initial buffer length
return byte[]

ToStream() public static method

public static ToStream ( this str ) : StringStream
str this
return StringStream

ToStream() public static method

public static ToStream ( this str, Encoding encoding ) : StringStream
str this
encoding System.Text.Encoding
return StringStream