IBinaryReader

Description

interface Tinman.Core.IO.IBinaryReader

Extended by

IDataStream
ISerializer

Base interface for classes that sequentially read data from a binary stream.

Public / Methods

Read


public method Read → (1)

bytes in : ByteBuffer

[not-null]
The buffer where the read bytes will be stored.

returns → int32

The number of bytes the have been 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.

ReadAll


public method ReadAll → (1)

bytes in : ByteBuffer

[not-null]
The buffer where the read bytes will be stored.

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.

ReadFloat32


public method ReadFloat32 → ()

returns → float32

The read value.

Reads a 32-bit floating point value from the data stream.

IOException

If an I/O error has occurred.

ReadFloat32s


public method ReadFloat32s → (3)

array in : float32 [ ]

[not-null]
The output array.

offset in : int32

[>=0]
Index of first array element to write.

count in : int32

[>=0]
Number of values to read.

Reads 32-bit floating point values from the data stream.

IOException

If an I/O error has occurred.

ReadFloat64


public method ReadFloat64 → ()

returns → float64

The read value.

Reads a 64-bit floating point value from the data stream.

IOException

If an I/O error has occurred.

ReadFloat64s


public method ReadFloat64s → (3)

array in : float64 [ ]

[not-null]
The output array.

offset in : int32

[>=0]
Index of first array element to write.

count in : int32

[>=0]
Number of values to read.

Reads 64-bit floating point values from the data stream.

IOException

If an I/O error has occurred.

ReadInt16


public method ReadInt16 → ()

returns → int16

The read value.

Reads a signed 16-bit integer value from the data stream using.

IOException

If an I/O error has occurred.

ReadInt16s


public method ReadInt16s → (3)

array in : int16 [ ]

[not-null]
The output array.

offset in : int32

[>=0]
Index of first array element to write.

count in : int32

[>=0]
Number of values to read.

Reads signed 16-bit integer value values from the data stream.

IOException

If an I/O error has occurred.

ReadInt32


public method ReadInt32 → ()

returns → int32

The read value.

Reads a signed 32-bit integer value from the data stream.

IOException

If an I/O error has occurred.

ReadInt32s


public method ReadInt32s → (3)

array in : int32 [ ]

[not-null]
The output array.

offset in : int32

[>=0]
Index of first array element to write.

count in : int32

[>=0]
Number of values to read.

Reads signed 32-bit integer value values from the data stream.

IOException

If an I/O error has occurred.

ReadInt64


public method ReadInt64 → ()

returns → int64

The read value.

Reads a signed 64-bit integer value from the data stream.

IOException

If an I/O error has occurred.

ReadInt64s


public method ReadInt64s → (3)

array in : int64 [ ]

[not-null]
The output array.

offset in : int32

[>=0]
Index of first array element to write.

count in : int32

[>=0]
Number of values to read.

Reads signed 64-bit integer value values from the data stream.

IOException

If an I/O error has occurred.

ReadInt8


public method ReadInt8 → ()

returns → int8

The read value.

Reads an 8-bit value from the stream.

IOException

If an I/O error has occurred.

ReadInt8s


public method ReadInt8s → (3)

array in : int8 [ ]

[not-null]
The output array.

offset in : int32

[>=0]
Index of first array element to write.

count in : int32

[>=0]
Number of values to read.

Reads signed 8-bit integer value values from the data stream.

IOException

If an I/O error has occurred.

ReadUInt16


public method ReadUInt16 → ()

returns → int32

The read value.

Reads an unsigned 16-bit integer value from the data stream.

IOException

If an I/O error has occurred.

ReadUInt32


public method ReadUInt32 → ()

returns → int64

The read value.

Reads an unsigned 32-bit integer value from the data stream.

IOException

If an I/O error has occurred.

ReadUInt8


public method ReadUInt8 → ()

returns → int32

The read value.

Reads an unsigned 8-bit integer from the data stream.

IOException

If an I/O error has occurred.

TryReadUInt8


public method TryReadUInt8 → ()

returns → int32

The unsigned 8-bit value or -1 if the end of the stream has been reached.

Reads an unsigned 8-bit value from the stream.

IOException

If an I/O error has occurred.

Extensions

ReadEof


public static method ReadEof → (1)

bytes in : ByteBuffer

[not-null]
The buffer where the read bytes will be stored.

returns → int32

The number of bytes that have been read into bytes in. A value of 0 indicates that the end of file has been reached (assuming bytes in had at least one remaining byte).

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.