@UnstableApi
class VorbisBitArray


Wraps a byte array, providing methods that allow it to be read as a Vorbis bitstream.

See the Vorbis bitpacking specification

Summary

Public constructors

Creates a new instance that wraps an existing array.

Public functions

Int

Returns the number of remaining bits.

Int

Returns the reading position in bits.

Boolean

Reads a single bit.

Int
readBits(numBits: Int)

Reads up to 32 bits.

Unit

Resets the reading position to zero.

Unit
setPosition(position: Int)

Sets the reading position in bits.

Unit
skipBits(numBits: Int)

Skips numberOfBits bits.

Public constructors

VorbisBitArray

VorbisBitArray(data: ByteArray!)

Creates a new instance that wraps an existing array.

Parameters
data: ByteArray!

the array to wrap.

Public functions

bitsLeft

fun bitsLeft(): Int

Returns the number of remaining bits.

getPosition

fun getPosition(): Int

Returns the reading position in bits.

readBit

fun readBit(): Boolean

Reads a single bit.

Returns
Boolean

true if the bit is set, false otherwise.

readBits

fun readBits(numBits: Int): Int

Reads up to 32 bits.

Parameters
numBits: Int

The number of bits to read.

Returns
Int

An integer whose bottom numBits bits hold the read data.

reset

fun reset(): Unit

Resets the reading position to zero.

setPosition

fun setPosition(position: Int): Unit

Sets the reading position in bits.

Parameters
position: Int

The new reading position in bits.

skipBits

fun skipBits(numBits: Int): Unit

Skips numberOfBits bits.

Parameters
numBits: Int

The number of bits to skip.