|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xiph.speex.Bits
Speex bit packing and unpacking class.
Field Summary | |
private int |
bitPtr
Position of the bit "cursor" within the current byte |
private int |
bytePtr
Position of the byte "cursor" |
private byte[] |
bytes
"raw" data |
static int |
DEFAULT_BUFFER_SIZE
Default buffer size |
Constructor Summary | |
Bits()
|
Method Summary | |
void |
advance(int n)
Advance n bits. |
byte[] |
getBuffer()
Returns the current buffer array. |
int |
getBufferSize()
Returns the number of bytes used in the current buffer. |
void |
init()
Initialise the bit packing variables. |
void |
pack(int data,
int nbBits)
Write N bits of the given data to the buffer. |
int |
peek()
Take a peek at the next bit. |
void |
read_from(byte[] newbytes,
int offset,
int len)
Read the given array into the buffer. |
protected void |
setBuffer(byte[] newBuffer)
Sets the buffer to the given value. |
int |
unpack(int nbBits)
Read the next N bits from the buffer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_BUFFER_SIZE
private byte[] bytes
private int bytePtr
private int bitPtr
Constructor Detail |
public Bits()
Method Detail |
public void init()
public void advance(int n)
n
- - the number of bits to advance.protected void setBuffer(byte[] newBuffer)
newBuffer
- public int peek()
public void read_from(byte[] newbytes, int offset, int len)
newbytes
- offset
- len
- public int unpack(int nbBits)
nbBits
- - the number of bits to read.
public void pack(int data, int nbBits)
data
- - the data to write.nbBits
- - the number of bits of the data to write.public byte[] getBuffer()
public int getBufferSize()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |