Initializes a new instance of the BinaryReader class based on the specified IFile instance and character encoding, and optionally leaves the file open.
The input IFile instance.
The character encoding to use, or an object implementing the IEncoding interface. Default to 'utf8'
true
to leave the file open after the BinaryReader object is disposed; otherwise, false
. Default to false
.
Get the underlying file instance of the BinaryReader.
Closes the current reader and the underlying file.
Returns the next available character and does not advance the byte or character position.
The next available character, or -1 if no more characters are available or the file does not support seeking.
Reads in a 32-bit integer in compressed format.
A 32-bit integer in compressed format.
Reads in a 64-bit integer in compressed format.
A 64-bit integer in compressed format.
Reads a boolean
value from the current file and advances the current position of the file by one byte.
true
if the byte is nonzero; otherwise, false
.
Reads the next byte from the current file and advances the current position of the file by one byte.
The next byte read from the current file.
Reads the specified number of bytes from the current file into a buffer and advances the current position by that number of bytes.
The number of bytes to read. This value must be 0 or a non-negative number or an exception will occur.
A buffer containing data read from the underlying file. This might be less than the number of bytes requested if the end of the file is reached.
Reads the next character from the current file and advances the current position of the file in accordance with the Encoding
used and the specific character being read from the file.
A character read from the current file.
Reads characters from the underlying file and advances the current position of the file in accordance with the Encoding
used and the specific character being read from the file.
The next character from the input file, or -1 if no characters are currently available.
Reads the specified number of characters from the current file, 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 file.
The number of characters to read.
A character array containing data read from the underlying file. This might be less than the number of characters requested if the end of the file is reached.
Reads an 8-byte floating point value from the current file and advances the current position of the file by eight bytes.
An 8-byte floating point value read from the current file.
Reads a 2-byte signed integer from the current file and advances the current position of the file by two bytes.
A 2-byte signed integer read from the current file.
Reads a 4-byte signed integer from the current file and advances the current position of the file by four bytes.
A 4-byte signed integer read from the current file.
Reads an 8-byte signed integer from the current file and advances the current position of the file by eight bytes.
An 8-byte signed integer read from the current file.
Reads a sequence of bytes from the current file and advances the position within the file by the number of bytes read.
A region of memory. When this method returns, the contents of this region are replaced by the bytes read from the current source.
The total number of bytes read into the buffer. This can be less than the number of bytes allocated in the buffer if that many bytes are not currently available, or zero (0) if the end of the file has been reached.
Reads the specified number of bytes from the file, starting from a specified point in the buffer.
The buffer to read data into.
The starting point in the buffer at which to begin reading into the buffer.
The number of bytes to read.
The number of bytes read into buffer. This might be less than the number of bytes requested if that many bytes are not available, or it might be zero if the end of the file is reached.
Reads, from the current file, the same number of characters as the length of the provided buffer, writes them in the provided buffer, and advances the current position in accordance with the Encoding
used and the specific character being read from the file.
A view of characters. When this method returns, the contents of this region are replaced by the characters read from the current source.
The total number of characters read into the buffer. This might be less than the number of characters requested if that many characters are not currently available, or it might be zero if the end of the file is reached.
Reads the specified number of characters from the file, starting from a specified point in the character array.
The buffer to read data into.
The starting point in the buffer at which to begin reading into the buffer.
The number of characters to read.
The total number of characters read into the buffer. This might be less than the number of characters requested if that many characters are not currently available, or it might be zero if the end of the file is reached.
Reads a string from the current file. You have to provide the length of it.
The number of bytes to read.
The string being read.
Reads a signed byte from this file and advances the current position of the file by one byte.
A signed byte read from the current file.
Reads a 4-byte floating point value from the current file and advances the current position of the file by four bytes.
A 4-byte floating point value read from the current file.
Reads a string from the current file. The string is prefixed with the length, encoded as an integer seven bits at a time.
The string being read.
Reads a 2-byte unsigned integer from the current file using little-endian encoding and advances the position of the file by two bytes.
A 2-byte unsigned integer read from this file.
Reads a 4-byte unsigned integer from the current file and advances the position of the file by four bytes.
A 4-byte unsigned integer read from this file.
Reads an 8-byte unsigned integer from the current file and advances the position of the file by eight bytes.
An 8-byte unsigned integer read from this file.
Generated using TypeDoc
Reads primitive data types as binary values in a specific encoding.