INNER CODE UNIT · Kotlin

bitValue

pedroSG94/RootEncoder · common/src/main/java/com/pedro/common/BitBuffer.kt:43

      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
  }

  fun skipBool() = skip(1)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…