Méthode | Description | |
---|---|---|
Close ( ) : void |
Closes the reader, including the underlying stream..
|
|
Dispose ( ) : void |
Disposes of the underlying stream.
|
|
EndianBinaryReader ( |
Equivalent of System.IO.BinaryWriter, but with either endianness, depending on the EndianBitConverter it is constructed with.
|
|
EndianBinaryReader ( |
Constructs a new binary reader with the given bit converter, reading to the given stream, using the given encoding.
|
|
Read ( ) : int |
Reads a single character from the stream, using the character encoding for this reader. If no characters have been fully read by the time the stream ends, -1 is returned.
|
|
Read ( byte buffer, int index, int count ) : int |
Reads the specified number of bytes into the given buffer, starting at the given index.
|
|
Read ( char data, int index, int count ) : int |
Reads the specified number of characters into the given buffer, starting at the given index.
|
|
Read7BitEncodedInt ( ) : int |
Reads a 7-bit encoded integer from the stream. This is stored with the least significant information first, with 7 bits of information per byte of value, and the top bit as a continuation flag. This method is not affected by the endianness of the bit converter.
|
|
ReadBigEndian7BitEncodedInt ( ) : int |
Reads a 7-bit encoded integer from the stream. This is stored with the most significant information first, with 7 bits of information per byte of value, and the top bit as a continuation flag. This method is not affected by the endianness of the bit converter.
|
|
ReadBoolean ( ) : bool |
Reads a boolean from the stream. 1 byte is read.
|
|
ReadByte ( ) : byte |
Reads a single byte from the stream.
|
|
ReadBytes ( int count ) : byte[] |
Reads the specified number of bytes, returning them in a new byte array. If not enough bytes are available before the end of the stream, this method will return what is available.
|
|
ReadBytesOrThrow ( int count ) : byte[] |
Reads the specified number of bytes, returning them in a new byte array. If not enough bytes are available before the end of the stream, this method will throw an IOException.
|
|
ReadDecimal ( ) : decimal |
Reads a decimal value from the stream, using the bit converter for this reader. 16 bytes are read.
|
|
ReadDouble ( ) : double |
Reads a double-precision floating-point value from the stream, using the bit converter for this reader. 8 bytes are read.
|
|
ReadInt16 ( ) : short |
Reads a 16-bit signed integer from the stream, using the bit converter for this reader. 2 bytes are read.
|
|
ReadInt32 ( ) : int |
Reads a 32-bit signed integer from the stream, using the bit converter for this reader. 4 bytes are read.
|
|
ReadInt64 ( ) : long |
Reads a 64-bit signed integer from the stream, using the bit converter for this reader. 8 bytes are read.
|
|
ReadSByte ( ) : sbyte |
Reads a single signed byte from the stream.
|
|
ReadSingle ( ) : float |
Reads a single-precision floating-point value from the stream, using the bit converter for this reader. 4 bytes are read.
|
|
ReadString ( int bytesToRead ) : string |
Reads a length-prefixed string from the stream, using the encoding for this reader. A 7-bit encoded integer is first read, which specifies the number of bytes to read from the stream. These bytes are then converted into a string with the encoding for this reader.
|
|
ReadUInt16 ( ) : ushort |
Reads a 16-bit unsigned integer from the stream, using the bit converter for this reader. 2 bytes are read.
|
|
ReadUInt32 ( ) : uint |
Reads a 32-bit unsigned integer from the stream, using the bit converter for this reader. 4 bytes are read.
|
|
ReadUInt64 ( ) : ulong |
Reads a 64-bit unsigned integer from the stream, using the bit converter for this reader. 8 bytes are read.
|
|
Seek ( int offset, SeekOrigin origin ) : void |
Seeks within the stream.
|
Méthode | Description | |
---|---|---|
CheckDisposed ( ) : void |
Checks whether or not the reader has been disposed, throwing an exception if so.
|
|
ReadInternal ( byte data, int size ) : void |
Reads the given number of bytes from the stream, throwing an exception if they can't all be read.
|
|
TryReadInternal ( byte data, int size ) : int |
Reads the given number of bytes from the stream if possible, returning the number of bytes actually read, which may be less than requested if (and only if) the end of the stream is reached.
|
public EndianBinaryReader ( |
||
bitConverter | Converter to use when reading data | |
stream | Stream | Stream to read data from |
Résultat | System |
public EndianBinaryReader ( |
||
bitConverter | Converter to use when reading data | |
stream | Stream | Stream to read data from |
encoding | Encoding to use when reading character data | |
Résultat | System |
public Read ( byte buffer, int index, int count ) : int | ||
buffer | byte | The buffer to copy data into |
index | int | The first index to copy data into |
count | int | The number of bytes to read |
Résultat | int |
public Read ( char data, int index, int count ) : int | ||
data | char | The buffer to copy data into |
index | int | The first index to copy data into |
count | int | The number of characters to read |
Résultat | int |
public ReadBigEndian7BitEncodedInt ( ) : int | ||
Résultat | int |
public ReadBytes ( int count ) : byte[] | ||
count | int | The number of bytes to read |
Résultat | byte[] |
public ReadBytesOrThrow ( int count ) : byte[] | ||
count | int | The number of bytes to read |
Résultat | byte[] |
public ReadString ( int bytesToRead ) : string | ||
bytesToRead | int | |
Résultat | string |
public Seek ( int offset, SeekOrigin origin ) : void | ||
offset | int | Offset to seek to. |
origin | SeekOrigin | Origin of seek operation. |
Résultat | void |