binary-streams / loggersoft.kotlin.streams / StreamInput / readInt

readInt

abstract fun readInt(bytes: Int, signed: Boolean = true, byteOrder: ByteOrder = defaultByteOrder): Long

Read integer value from the stream with specified bytes count and byteOrder. If signed is true the last bit interprets as a sign. This means that if last bit is 1 the rest of the bits higher than last bit would be filled by 1. The bytes should be in range 1..8.

Exceptions

IllegalArgumentException - , EOFException

open fun readInt(byteOrder: ByteOrder = defaultByteOrder): Int

Reads Int from the stream with specified byteOrder.

Exceptions

EOFException -