C# Класс HttpMultipartParser.BinaryStreamStack

Provides character based and byte based stream-like read operations over multiple streams and provides methods to add data to the front of the buffer.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BinaryStreamStack ( ) : System.Collections.Generic

Initializes a new instance of the BinaryStreamStack class with the default encoding of UTF8.

BinaryStreamStack ( Encoding encoding ) : System.Collections.Generic

Initializes a new instance of the BinaryStreamStack class.

HasData ( ) : bool

Returns true if there is any data left to read.

Peek ( ) : BinaryReader

Returns the reader on the top of the stack but does not remove it.

Pop ( ) : BinaryReader

Returns the reader on the top of the stack and removes it

Push ( byte data ) : void

Pushes data to the front of the stack. The most recently pushed data will be read first.

Read ( ) : int

Reads a single byte as an integer from the stack. 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 stack, 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 stack, starting from a specified point in the byte array.

ReadByteLine ( ) : byte[]

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

ReadByteLine ( bool &hitStreamEnd ) : byte[]

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

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

ReadLine ( bool &hitStreamEnd ) : string

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

Приватные методы

Метод Описание
NextStream ( ) : BinaryReader

Removes the current reader from the stack and ensures it is correctly destroyed and then returns the next available reader. If no reader is available this method returns null.

Описание методов

BinaryStreamStack() публичный Метод

Initializes a new instance of the BinaryStreamStack class with the default encoding of UTF8.
public BinaryStreamStack ( ) : System.Collections.Generic
Результат System.Collections.Generic

BinaryStreamStack() публичный Метод

Initializes a new instance of the BinaryStreamStack class.
public BinaryStreamStack ( Encoding encoding ) : System.Collections.Generic
encoding System.Text.Encoding /// The encoding to use for character based operations. ///
Результат System.Collections.Generic

HasData() публичный Метод

Returns true if there is any data left to read.
public HasData ( ) : bool
Результат bool

Peek() публичный Метод

Returns the reader on the top of the stack but does not remove it.
public Peek ( ) : BinaryReader
Результат System.IO.BinaryReader

Pop() публичный Метод

Returns the reader on the top of the stack and removes it
public Pop ( ) : BinaryReader
Результат System.IO.BinaryReader

Push() публичный Метод

Pushes data to the front of the stack. The most recently pushed data will be read first.
public Push ( byte data ) : void
data byte /// The data to add to the stack. ///
Результат void

Read() публичный Метод

Reads a single byte as an integer from the stack. Returns -1 if no data is left to read.
public Read ( ) : int
Результат int

Read() публичный Метод

Reads the specified number of bytes from the stack, 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. ///
Результат int

Read() публичный Метод

Reads the specified number of characters from the stack, 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. ///
Результат int

ReadByteLine() публичный Метод

Reads the specified number of characters from the stack, starting from a specified point in the byte array.
public ReadByteLine ( ) : byte[]
Результат byte[]

ReadByteLine() публичный Метод

Reads a line from the stack delimited by the newline for this platform. The newline characters will not be included in the stream
public ReadByteLine ( bool &hitStreamEnd ) : byte[]
hitStreamEnd bool /// This will be set to true if we did not end on a newline but instead found the end of /// our data. ///
Результат byte[]

ReadLine() публичный Метод

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
Результат string

ReadLine() публичный Метод

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 ( bool &hitStreamEnd ) : string
hitStreamEnd bool /// This will be set to true if we did not end on a newline but instead found the end of /// our data. ///
Результат string