VorbisBitArray
@UnstableApi
public final 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 |
|---|
VorbisBitArray(byte[] data)Creates a new instance that wraps an existing array. |
Public methods |
|
|---|---|
int |
bitsLeft()Returns the number of remaining bits. |
int |
Returns the reading position in bits. |
boolean |
readBit()Reads a single bit. |
int |
readBits(int numBits)Reads up to 32 bits. |
void |
reset()Resets the reading position to zero. |
void |
setPosition(int position)Sets the reading position in bits. |
void |
skipBits(int numBits)Skips |
Public constructors
VorbisBitArray
public VorbisBitArray(byte[] data)
Creates a new instance that wraps an existing array.
| Parameters | |
|---|---|
byte[] data |
the array to wrap. |
Public methods
readBit
public boolean readBit()
Reads a single bit.
| Returns | |
|---|---|
boolean |
|
readBits
public int readBits(int numBits)
Reads up to 32 bits.
| Parameters | |
|---|---|
int numBits |
The number of bits to read. |
| Returns | |
|---|---|
int |
An integer whose bottom |
setPosition
public void setPosition(int position)
Sets the reading position in bits.
| Parameters | |
|---|---|
int position |
The new reading position in bits. |
skipBits
public void skipBits(int numBits)
Skips numberOfBits bits.
| Parameters | |
|---|---|
int numBits |
The number of bits to skip. |