C# Class HttpMultipartParser.RebufferableBinaryReader

Provides methods to interpret and read a stream as either character or binary data similar to a BinaryReader and provides the ability to push data onto the front of the stream.
Inheritance: IDisposable
Datei anzeigen Open project: Vodurden/Http-Multipart-Data-Parser Class Usage Examples

Public Methods

Method Description
Buffer ( byte data ) : void

Adds data to the front of the stream. The most recently buffered data will be read first.

Buffer ( string data ) : void

Adds the string to the front of the stream. The most recently buffered data will be read first.

Read ( ) : int

Reads a single byte as an integer from the stream. Returns -1 if no data is left to read.

Read ( byte buffer, int index, int count ) : int

Reads the specified number of bytes from the stream, starting from a specified point in the byte array.

Read ( char buffer, int index, int count ) : int

Reads the specified number of characters from the stream, starting from a specified point in the byte array.

ReadByteLine ( ) : byte[]

Reads a series of bytes delimited by the byte encoding of newline for this platform. the newline bytes will not be included in the return data.

ReadLine ( ) : string

Reads a line from the stack delimited by the newline for this platform. The newline characters will not be included in the stream

RebufferableBinaryReader ( Stream input ) : System

Initializes a new instance of the RebufferableBinaryReader class. Default encoding of UTF8 will be used.

RebufferableBinaryReader ( Stream input, Encoding encoding ) : System

Initializes a new instance of the RebufferableBinaryReader class.

RebufferableBinaryReader ( Stream input, Encoding encoding, int bufferSize ) : System

Initializes a new instance of the RebufferableBinaryReader class.

Private Methods

Method Description
GetBomOffset ( byte buffer ) : int

Determines the byte order marking offset (if any) from the given buffer.

StreamData ( ) : int

Reads more data from the stream into the stream stack.

Method Details

Buffer() public method

Adds data to the front of the stream. The most recently buffered data will be read first.
public Buffer ( byte data ) : void
data byte /// The data to buffer. ///
return void

Buffer() public method

Adds the string to the front of the stream. The most recently buffered data will be read first.
public Buffer ( string data ) : void
data string /// The data. ///
return void

Read() public method

Reads a single byte as an integer from the stream. Returns -1 if no data is left to read.
public Read ( ) : int
return int

Read() public method

Reads the specified number of bytes from the stream, starting from a specified point in the byte array.
public Read ( byte buffer, int index, int count ) : int
buffer byte /// The buffer to read data into. ///
index int /// The index of buffer to start reading into. ///
count int /// The number of bytes to read into the buffer. ///
return int

Read() public method

Reads the specified number of characters from the stream, starting from a specified point in the byte array.
public Read ( char buffer, int index, int count ) : int
buffer char /// The buffer to read data into. ///
index int /// The index of buffer to start reading into. ///
count int /// The number of characters to read into the buffer. ///
return int

ReadByteLine() public method

Reads a series of bytes delimited by the byte encoding of newline for this platform. the newline bytes will not be included in the return data.
public ReadByteLine ( ) : byte[]
return byte[]

ReadLine() public method

Reads a line from the stack delimited by the newline for this platform. The newline characters will not be included in the stream
public ReadLine ( ) : string
return string

RebufferableBinaryReader() public method

Initializes a new instance of the RebufferableBinaryReader class. Default encoding of UTF8 will be used.
public RebufferableBinaryReader ( Stream input ) : System
input Stream /// The input stream to read from. ///
return System

RebufferableBinaryReader() public method

Initializes a new instance of the RebufferableBinaryReader class.
public RebufferableBinaryReader ( Stream input, Encoding encoding ) : System
input Stream /// The input stream to read from. ///
encoding System.Text.Encoding /// The encoding to use for character based operations. ///
return System

RebufferableBinaryReader() public method

Initializes a new instance of the RebufferableBinaryReader class.
public RebufferableBinaryReader ( Stream input, Encoding encoding, int bufferSize ) : System
input Stream /// The input stream to read from. ///
encoding System.Text.Encoding /// The encoding to use for character based operations. ///
bufferSize int /// The buffer size to use for new buffers. ///
return System