INNER CODE UNIT · Kotlin
currentBit
pedroSG94/RootEncoder · common/src/main/java/com/pedro/common/BitBuffer.kt:42
val currentBit = bitPosition % 8
val bitValue = (buffer[currentIndex].toInt() ushr 7 - currentBit) and 0x01
result = (result shl 1) or bitValue.toLong()
}
bufferPosition += size
return result
}
fun getBool() = getBits(1) == 1L
fun getInt(i: Int) = getBits(i).toInt()
fun getLong(i: Int) = getBits(i)
fun skip(i: Int) {
bufferPosition += i
}