IByteReader
Description
- Derived from
- Extended by
Base interface for classes that sequentially read data from a binary stream.
The methods of this interface read single-byte values which are not affected by byte order.
Public / Methods
Read
Reads a number of bytes from the stream.
The number of bytes that are read from the stream may be less than the number of ByteBuffer.Remaining bytes in the given ByteBuffer, for any arbitrary reason.
- IOException
-
If an I/O error has occurred.
ReadBools
Reads 8-bit boolean values from the stream.
Calling this method is equivalent to calling IByteReader.ReadBool sequentially for each element in the given array in segment but may be implemented in a more efficient way.
- IOException
-
If an I/O error has occurred.
ReadInt8s
Reads signed 8-bit integer values from the stream.
Calling this method is equivalent to calling ReadInt8 sequentially for each element in the given array in segment but may be implemented in a more efficient way.
- IOException
-
If an I/O error has occurred.
TryReadUInt8
Tries to read an unsigned 8-bit integer value from the stream.
- IOException
-
If an I/O error has occurred.
Extensions
ReadAll
Reads a number of bytes from the stream.
The number of bytes that are read from the stream will be equal to the number of ByteBuffer.Remaining bytes in the given ByteBuffer.
- IOException
-
If an I/O error has occurred.
ReadEof
Reads a number of bytes from the stream.
The number of bytes that are read from the stream will be equal to the number of ByteBuffer.Remaining bytes in the given ByteBuffer, except when the end of file is reached (the returned value will be smaller in this case).
- IOException
-
If an I/O error has occurred.
ReadInt16_BE
Reads a big-endian 16-bit signed integer from the stream.
- IOException
-
If an I/O error has occurred.
ReadInt16_LE
Reads a little-endian 16-bit signed integer from the stream.
- IOException
-
If an I/O error has occurred.
ReadInt32_BE
Reads a big-endian 32-bit signed integer from the stream.
- IOException
-
If an I/O error has occurred.
ReadInt32_LE
Reads a little-endian 32-bit signed integer from the stream.
- IOException
-
If an I/O error has occurred.
ReadInt64_BE
Reads a big-endian 64-bit signed integer from the stream.
- IOException
-
If an I/O error has occurred.
ReadInt64_LE
Reads a little-endian 64-bit signed integer from the stream.
- IOException
-
If an I/O error has occurred.
ReadUInt8
Reads an unsigned 8-bit integer value from the stream.
This method is equivalent to IByteReader.ReadInt8, except that it applies the bitmask 0xFF
to the read value, before returning it. It does not choose a different binary encoding in the first place.
- IOException
-
If an I/O error has occurred.
ReadUTF8
Reads a string from the given sequence of UTF-8 code units.
- IOException
-
If an I/O error has occurred.
ReadVarInt32
Reads a 32-bit value from the stream, using variable coding from one to five bytes.
The encoding is independent on byte endianness.
- IOException
-
If an I/O error has occurred.
- See also
ReadVarInt64
Reads a 64-bit value from the stream, using variable coding from one to nine (with shortcut opt coding) or ten (without shortcut opt coding) bytes.
The encoding is independent on byte endianness.
- IOException
-
If an I/O error has occurred.
- See also
ReadVarUInt32
Reads a 32-bit value from the stream, using variable coding from one to five bytes.
The encoding is independent on byte endianness.
- IOException
-
If an I/O error has occurred.
- See also
ReadVarUInt64
Reads a 64-bit value from the stream, using variable coding from one to nine (with shortcut opt coding) or ten (without shortcut opt coding) bytes.
The encoding is independent on byte endianness.
- IOException
-
If an I/O error has occurred.
- See also