| Constructor and Description |
|---|
BitBuffer()
Constructs an empty bit buffer (length 0).
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendBits(int val,
int len)
Appends the specified number of low bits of the specified value
to this sequence.
|
void |
appendData(QrSegment seg)
Appends the bit data of the specified segment to this bit buffer.
|
int |
bitLength()
Returns the length of this sequence, which is a non-negative value.
|
BitBuffer |
clone()
Returns a copy of this bit buffer object.
|
int |
getBit(int index)
Returns the bit at the specified index, yielding 0 or 1.
|
byte[] |
getBytes()
Packs this buffer's bits into bytes in big endian,
padding with '0' bit values, and returns the new array.
|
public int bitLength()
public int getBit(int index)
index - the index to get the bit atIndexOutOfBoundsException - if index < 0 or index ≥ bitLengthpublic byte[] getBytes()
null)public void appendBits(int val,
int len)
val - the value to appendlen - the number of low bits in the value to takepublic void appendData(QrSegment seg)
seg - the segment whose data to append (not null)NullPointerException - if the segment is nullCopyright © 2018. All rights reserved.