|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.asn1.ber.tlv.TLV
This class is used to store Tag, Length and Value decoded from a PDU.
Field Summary | |
static byte |
CONSTRUCTED_FLAG
tag flag for the primitive/constructed bit - 0010 0000 - 0x20 |
static int |
LENGTH_EXTENSION_RESERVED
Value of the reserved extension |
static int |
LENGTH_LONG_FORM
A mask to get the Length form |
static int |
LENGTH_SHORT_MASK
A mask to get the long form value |
static int |
SHORT_MASK
tag mask for the short tag format - 0001 1111 - 0x1F |
static byte |
TYPE_CLASS_MASK
mask to get the type class value |
static byte |
TYPE_CLASS_UNIVERSAL
value for the universal type class |
Constructor Summary | |
TLV()
Creates a new TLV object. |
Method Summary | |
static byte[] |
getBytes(int length)
Utility function that return a byte array representing the length |
int |
getExpectedLength()
Get the TLV expected length. |
int |
getLength()
|
int |
getLengthBytesRead()
|
int |
getLengthNbBytes()
|
static int |
getNbBytes(int length)
Utility function that return the number of bytes necessary to store the length |
TLV |
getParent()
|
int |
getSize()
The TLV size is calculated by adding the Tag's size, the Length's size and the Value's length, if any. |
byte |
getTag()
|
Value |
getValue()
|
void |
incLengthBytesRead()
|
boolean |
isConstructed()
Checks to see if the current tlv's tag is constructed. |
static boolean |
isConstructed(byte tag)
Checks to see if the tag is constructed. |
static boolean |
isPrimitive(byte tag)
Checks to see if the tag represented by this Tag is primitive or constructed. |
static boolean |
isUniversal(byte tag)
Tells if the tag is Universal or not |
void |
reset()
Reset the TLV, so it can be reused for the next PDU decoding. |
void |
setExpectedLength(int expectedLength)
Set the new expected length of the current TLV. |
void |
setLength(int length)
|
void |
setLengthBytesRead(int lengthBytesRead)
|
void |
setLengthNbBytes(int lengthNbBytes)
|
void |
setParent(TLV parent)
|
void |
setTag(byte tag)
|
java.lang.String |
toString()
Get a String representation of the TLV |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte CONSTRUCTED_FLAG
public static final byte TYPE_CLASS_MASK
public static final byte TYPE_CLASS_UNIVERSAL
public static final int SHORT_MASK
public static final transient int LENGTH_LONG_FORM
public static final transient int LENGTH_EXTENSION_RESERVED
public static final transient int LENGTH_SHORT_MASK
Constructor Detail |
public TLV()
Method Detail |
public static boolean isConstructed(byte tag)
public boolean isConstructed()
public static boolean isPrimitive(byte tag)
public static boolean isUniversal(byte tag)
public void reset()
public byte getTag()
public void setTag(byte tag)
public Value getValue()
public java.lang.String toString()
public int getSize()
public static int getNbBytes(int length)
length
- The length to store in a byte array
public static byte[] getBytes(int length)
length
- The length to store in a byte array
public TLV getParent()
public void setParent(TLV parent)
parent
- The parent to set.public int getExpectedLength()
public void setExpectedLength(int expectedLength)
expectedLength
- The expectedLength to set.public int getLengthNbBytes()
public void setLengthNbBytes(int lengthNbBytes)
public int getLength()
public void setLength(int length)
public int getLengthBytesRead()
public void setLengthBytesRead(int lengthBytesRead)
public void incLengthBytesRead()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |