![]() ![]() | ||
As discussed in the In Depth section of this chapter, you can use the BinaryClass class to read binary data from files once you have a FileStream object; here's this class's hierarchy:
You can find the more notable public properties of the BinaryReader class in Table 13.18 and the more notable methods in Table 13.19.
Property |
Means |
---|---|
BaseStream |
Holds the underlying stream of the binary reader, giving you access to that stream's properties and methods. |
Method |
Means |
---|---|
Close |
Closes the binary reader as well as the underlying stream. |
PeekChar |
Peeks ahead and returns the next available character (but does not advance the read/write position). |
Read |
Reads characters from the underlying stream and advances the current position of the stream. |
ReadBoolean |
Reads a Boolean from the stream. |
ReadByte |
Reads the next byte from the stream. |
ReadBytes |
Reads a number of bytes from the stream into a byte array. |
ReadChar |
Reads the next character from the stream. |
ReadChars |
Reads a number of characters from the stream. |
ReadDecimal |
Reads a decimal value from the stream. |
ReadDouble |
Reads an 8-byte floating-point value from the stream. |
ReadInt16 |
Reads a 2-byte signed integer from the stream. |
ReadInt32 |
Reads a 4-byte signed integer from the stream. |
ReadInt64 |
Reads an 8-byte signed integer from the stream. |
ReadSByte |
Reads a signed byte from the stream. |
ReadSingle |
Reads a 4-byte floating-point value from the stream. |
ReadString |
Reads a string from the current stream. |
ReadUInt16 |
Reads a 2-byte unsigned integer from the stream. |
ReadUInt32 |
Reads a 4-byte unsigned integer from the stream. |
ReadUInt64 |
Reads an 8-byte unsigned integer from the stream. |
![]() ![]() | ||