BinaryReader

BinaryReader


Provides a set of methods to read typed information from a Stream.


Remarks

The bytes from a stream can be read and cast to a specific datatype. Each datatype will determine the number of bytes to be read from the stream. Once the number of bytes have been read, they are assembled into the requested datatype, advancing the position in the stream the required number of bytes.

Characters can be read from the Stream using the provided Encoding system. The default encoding system is equal to New UTF8Encoding.

To create a new BinaryReader use the public constructor.

 Set reader = Cor.NewBinaryReader(MyFileStream)

 - or -

 Set reader = NewBinaryReader(MyFileStream)
 

See Also

Project VBCorLib Overview | Constructors | BinaryWriter

Implements:

IObject 

Public:

Properties:

NameDescription
 BaseStream (get)Returns the underlying Stream being read by the Reader. 

Methods:

NameDescription
 CloseReaderCloses the reader and underlying Stream. 
 EqualsReturns a boolean indicating if the value and this object instance are the same instance. 
 GetHashCodeReturns a pseudo-unique number identifying this instance. 
 PeekCharReturns the next character to be decoded from the byte stream. The position in the stream is not advanced after the read. 
 ReadFills either a Byte array or Integer array with the specified number of elements. Or returns the next character to be decoded from the stream. 
 ReadBooleanReturns a boolean from the stream. 
 ReadByteReads the next byte in the stream, and advances the position one byte. 
 ReadBytesReads the specified number of bytes from the stream and returns them in an array. 
 ReadCharReads the next decode character in the stream, and advances the position the number of bytes requirece to assemble a single character. 
 ReadCharsReturns a specified number of characters decoded from the stream. 
 ReadCurrencyReads 8 bytes from the stream and returns them as a Currency datatype. 
 ReadDateReads 8 bytes from the stream and returns them as a Date datatype. 
 ReadDecimalReads 16 bytes from the stream and returns them as a Variant Decimal datatype. 
 ReadDoubleReads 8 bytes from the stream and returns them as a Double datatype. 
 ReadIntegerReads 2 bytes from the stream and returns them as an Integer datatype. 
 ReadLongReads 4 bytes from the stream and returns them as a Long datatype. 
 ReadSingleReads 4 bytes from the stream and returns them as a Single datatype. 
 ReadStringReads a String from the stream. 
 ToStringReturns a string representation of this object instance.