public class BinaryReader : IDisposable
|
ctor #1 | Overloaded:.ctor(Stream input) Initializes a new instance of the BinaryReader class based on the supplied stream and using UTF8Encoding. |
ctor #2 | Overloaded:.ctor(Stream input, Encoding encoding) Initializes a new instance of the BinaryReader class based on the supplied stream and a specific character encoding. |
BaseStream | Read-only Exposes access to the underlying stream of the BinaryReader. |
Close | Closes the current reader and the underlying stream. |
Equals (inherited from System.Object) |
See base class member description: System.Object.Equals Derived from System.Object, the primary base class for all objects. |
GetHashCode (inherited from System.Object) |
See base class member description: System.Object.GetHashCode Derived from System.Object, the primary base class for all objects. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
PeekChar | Returns the next available character and does not advance the byte or character position. |
Read | Overloaded:Read() Reads characters from the underlying stream and advances the current position of the stream in accordance with the Encoding used and the specific character being read from the stream. |
Read | Overloaded:Read(byte[] buffer, int index, int count) Reads count bytes from the stream with index as the starting point in the byte array. |
Read | Overloaded:Read(char[] buffer, int index, int count) Reads count characters from the stream with index as the starting point in the character array. |
ReadBoolean | Reads a Boolean from the current stream and advances the current position of the stream by one byte. |
ReadByte | Reads the next byte from the current stream and advances the current position of the stream by 1 byte. |
ReadBytes | Reads count bytes from the current stream into a byte array and advances the current position by count bytes. |
ReadChar | Reads the next character from the current stream and advances the current position of the stream in accordance with the Encoding used and the specific character being read from the stream. |
ReadChars | Reads count characters from the current stream, returns the data in a character array, and advances the current position in accordance with the Encoding used and the specific character being read from the stream. |
ReadDecimal | Reads a decimal value from the current stream and advances the current position of the stream by sixteen bytes. |
ReadDouble | Reads an 8-byte floating point value from the current stream and advances the current position of the stream by eight bytes. |
ReadInt16 | Reads a 2-byte signed integer from the current stream and advances the current position of the stream by two bytes. |
ReadInt32 | Reads a 4-byte signed integer from the current stream and advances the current position of the stream by four bytes. |
ReadInt64 | Reads an 8-byte signed integer from the current stream and advances the current position of the stream by four bytes. |
ReadSByte | Reads a signed byte from this stream and advances the current position of the stream by one byte. |
ReadSingle | Reads a 4-byte floating point value from the current stream and advances the current position of the stream by four bytes. |
ReadString | Reads a String from the current stream. The String is prefixed with the length, encoded as an integer 7 bits at a time. |
ReadUInt16 | Reads a 2-byte unsigned integer from the current stream using little endian encoding and advances the position of the stream by two bytes. |
ReadUInt32 | Reads a 4-byte unsigned integer from the current stream and advances the position of the stream by four bytes. |
ReadUInt64 | Reads an 8-byte unsigned integer from the current stream and advances the position of the stream by eight bytes. |
ToString (inherited from System.Object) |
See base class member description: System.Object.ToString Derived from System.Object, the primary base class for all objects. |
Dispose | Releases the unmanaged resources used by the BinaryReader and optionally releases the managed resources. |
FillBuffer | Fills the internal buffer with the specified number of bytes read from the stream. |
Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Read7BitEncodedInt | Reads in a 32-bit integer in a compressed format. |
Hierarchy:
public BinaryReader( |
input
Exception Type | Condition |
---|---|
ArgumentException | The stream does not support writing, or the stream is already closed. |
ArgumentNullException | input is null. |
input
encoding
Exception Type | Condition |
---|---|
ArgumentException | The stream does not support reading. |
ArgumentNullException | input or encoding is null. |
public virtual Stream BaseStream {get;}
|
public virtual void Close(); |
Flushing the stream will not flush its underlying encoder unless you explicitly call Stream.Flush or Close. Setting StreamWriter.AutoFlush to true means that data will be flushed from the buffer to the stream, but the encoder state will not be flushed. This allows the encoder to keep its state (partial characters) so that it can encode the next block of characters correctly. This scenario affects UTF8 and UTF7 where certain characters can only be encoded after the encoder receives the adjacent character or characters.
protected virtual void Dispose( |
disposing
When the disposing parameter is true, this method releases all resources held by any managed objects that this BinaryReader references. This method invokes the Dispose() method of each referenced object.
For more information about Dispose and Object.Finalize, see the conceptual topic at MSDN: cleaningupunmanagedresources and the conceptual topic at MSDN: overridingfinalizemethod.
protected virtual void FillBuffer( |
numBytes
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached before numBytes could be read. |
IOException | An I/O error occurs. |
~BinaryReader(); |
public virtual int GetHashCode(); |
public Type GetType(); |
protected object MemberwiseClone(); |
public virtual int PeekChar(); |
Exception Type | Condition |
---|---|
IOException | An I/O error occurs. |
public virtual int Read(); |
Exception Type | Condition |
---|---|
IOException | An I/O error occurs. |
buffer
index
count
Exception Type | Condition |
---|---|
ArgumentException | The buffer length minus index is less than count. |
ArgumentNullException | buffer is null. |
ArgumentOutOfRangeException | index or count is negative. |
IOException | An I/O error occurs. |
buffer
index
count
Exception Type | Condition |
---|---|
ArgumentException | The buffer length minus index is less than count. |
ArgumentNullException | buffer is null. |
ArgumentOutOfRangeException | index or count is negative. |
IOException | An I/O error occurs. |
protected int Read7BitEncodedInt(); |
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
public virtual bool ReadBoolean(); |
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
public virtual byte ReadByte(); |
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
count
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
ArgumentOutOfRangeException | count is negative. |
public virtual char ReadChar(); |
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
count
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
ArgumentOutOfRangeException | count is negative. |
public virtual decimal ReadDecimal(); |
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
public virtual double ReadDouble(); |
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
public virtual short ReadInt16(); |
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
public virtual int ReadInt32(); |
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
public virtual long ReadInt64(); |
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
[CLSCompliant(false)] |
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
public virtual float ReadSingle(); |
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
public virtual string ReadString(); |
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
[CLSCompliant(false)] |
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
[CLSCompliant(false)] |
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
[CLSCompliant(false)] |
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream is reached. |
IOException | An I/O error occurs. |
public virtual string ToString(); |