|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.asn1.primitives.BitString
public class BitString
Implement the Bit String primitive type. A BitString is internally stored as an array of int.
Field Summary | |
---|---|
static BitString |
EMPTY_STRING
A null MutableString |
static boolean |
STREAMED
A flag to mark the OctetString as Streamed (for OctetString larger than 1024 chars) |
Constructor Summary | |
---|---|
BitString(byte[] bytes)
Creates a BitString with a value. |
|
BitString(int length)
Creates a BitString with a specific length (length is the number of bits). |
|
BitString(int length,
boolean isStreamed)
Creates a streamed BitString with a specific length. |
Method Summary | |
---|---|
void |
clearBit(int pos)
Clear a bit at a specified position. |
boolean |
getBit(int pos)
Get the bit stored into the BitString at a specific position. |
byte[] |
getData()
Get the representation of a BitString |
byte |
getUnusedBits()
Get the number of unused bits |
boolean |
isStreamed()
Tells if the OctetString is streamed or not |
void |
setBit(int pos)
Set a bit at a specified position. |
void |
setData(byte[] bytes)
Set a new BitString in the BitString. |
int |
size()
|
java.lang.String |
toString()
Return a native String representation of the BitString. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final BitString EMPTY_STRING
public static final boolean STREAMED
Constructor Detail |
---|
public BitString(int length)
length
- The BitString length (it's a number of bits)public BitString(int length, boolean isStreamed)
length
- The BitString length, in number of bitsisStreamed
- Tells if the BitString must be streamed or notpublic BitString(byte[] bytes)
bytes
- The value to store. The first byte contains the number of
unused bitsMethod Detail |
---|
public void setData(byte[] bytes)
bytes
- The string to storepublic byte[] getData()
public byte getUnusedBits()
public void setBit(int pos)
pos
- The bit to setpublic void clearBit(int pos)
pos
- The bit to clearpublic boolean getBit(int pos)
pos
- The position of the requested bit.
true
if the bit is set, false
otherwisepublic int size()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isStreamed()
true
if the OctetString is streamed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |