|
|||||||||||
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.Length
The Length part of a TLV. We are not dealing with indefinite length.
Field Summary | |
private int |
currentLength
Stores the number of bytes already read for a long Length form |
private boolean |
definiteForm
A flag used with definite forms length. |
private int |
expectedLength
If the Length is in a long form, this variable store the expected number of bytes to be read to obtain the length |
private int |
length
The length of the following value |
static int |
LENGTH_EXTENSION_RESERVED
Value of the reserved extension |
static int |
LENGTH_LONG_FORM
A mask to get the Length form |
static long |
serialVersionUID
|
static int |
SHORT_MASK
A mask to get the long form value |
private int |
size
The size of the Length part. |
Constructor Summary | |
Length()
Creates a new object. |
Method Summary | |
java.lang.Object |
clone()
Clone the object |
static byte[] |
getBytes(int length)
Utility function that return a byte array representing the length |
int |
getCurrentLength()
Get the current number of bytes read |
int |
getExpectedLength()
Get the expected length |
int |
getLength()
Get the Value length |
static int |
getNbBytes(int length)
Utility function that return the number of bytes necessary to store the length |
int |
getSize()
Get the size of the Length element |
void |
incCurrentLength()
Increment the Length being read |
void |
incSize()
Increment the size of the Length element. |
boolean |
isDefiniteForm()
Get the length's type |
void |
reset()
Reset the Length object |
void |
setCurrentLength(int currentLength)
Set the current length of the Length |
void |
setDefiniteForm(boolean definiteForm)
Set the length's form |
void |
setExpectedLength(int expectedLength)
Set the expected long form length |
void |
setLength(int length)
Set the length of the Value part |
void |
setSize(int size)
Set the Length's size |
java.lang.String |
toString()
Return a String representing the Length |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final long serialVersionUID
public static final transient int LENGTH_LONG_FORM
public static final transient int LENGTH_EXTENSION_RESERVED
public static final transient int SHORT_MASK
private int length
private int size
private transient int expectedLength
private int currentLength
private boolean definiteForm
Constructor Detail |
public Length()
Method Detail |
public void reset()
public int getLength()
public void setLength(int length)
length
- The length of the Value part.public int getCurrentLength()
public void setCurrentLength(int currentLength)
currentLength
- The currentLength to set.public void incCurrentLength()
public int getExpectedLength()
public void setExpectedLength(int expectedLength)
expectedLength
- The long form expected length to set.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
- Thrown if any problem occurs.public int getSize()
public void incSize()
public java.lang.String toString()
public void setSize(int size)
size
- The lengthSize to set.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 boolean isDefiniteForm()
public void setDefiniteForm(boolean definiteForm)
definiteForm
- The definiteForm flag to set.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |