binary-streams / loggersoft.kotlin.streams / kotlin.ByteArray / toInteger

toInteger

fun ByteArray.toInteger(bytes: Int = 8, signed: Boolean = true, byteOrder: ByteOrder = nativeByteOrder, offset: Int = 0): Long

Extracts Long value from this byte array starting from offset 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.