|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pdfbox.io.ccitt.PackedBitArray
public class PackedBitArray
Represents an array of bits packed in a byte array of fixed size.
Constructor Summary | |
---|---|
PackedBitArray(int bitCount)
Constructs a new bit array. |
Method Summary | |
---|---|
void |
clear()
Clear all bits in the array. |
void |
clear(int offset)
Clears a bit at the given offset. |
void |
clearBits(int offset,
int length)
Clears a run of bits at the given offset. |
int |
getBitCount()
Returns the number of bits maintained by this array. |
int |
getByteCount()
Returns the size of the byte buffer for this array. |
byte[] |
getData()
Returns the underlying byte buffer. |
void |
set(int offset)
Sets a bit at the given offset. |
void |
setBits(int offset,
int length)
Sets a run of bits at the given offset to either 1. |
void |
setBits(int offset,
int length,
int bit)
Sets a run of bits at the given offset to either 1 or 0. |
static String |
toBitString(byte data)
Converts a byte to a "binary" String of 0s and 1s. |
static String |
toBitString(byte[] data)
Converts a series of bytes to a "binary" String of 0s and 1s. |
static String |
toBitString(byte[] data,
int start,
int len)
Converts a series of bytes to a "binary" String of 0s and 1s. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PackedBitArray(int bitCount)
bitCount
- the number of bits to maintainMethod Detail |
---|
public void set(int offset)
offset
- the offsetpublic void clear(int offset)
offset
- the offsetpublic void setBits(int offset, int length, int bit)
offset
- the offsetlength
- the number of bits to setbit
- 1 to set the bit, 0 to clear itpublic void setBits(int offset, int length)
offset
- the offsetlength
- the number of bits to setpublic void clearBits(int offset, int length)
offset
- the offsetlength
- the number of bits to clearpublic void clear()
public int getBitCount()
public int getByteCount()
public byte[] getData()
Note: the actual buffer is returned. If it's manipulated the content of the bit array changes.
public String toString()
toString
in class Object
public static String toBitString(byte data)
data
- the value to convert
public static String toBitString(byte[] data)
data
- the data
public static String toBitString(byte[] data, int start, int len)
data
- the datastart
- the start offsetlen
- the number of bytes to convert
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |