|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.asn1.ber.Tuple
public class Tuple
TLV Tuple used by the value chunking decoder. Because the length field is a primitive int it's maximum value is 2,147,483,647 a single TLV's tuple cannot have a length over this amount or a value size over 2 GB.
Field Summary | |
---|---|
private static int |
BIT_13
precalculated left shift of 1 by 14 places |
private static int |
BIT_15
precalculated left shift of 1 by 16 places |
private static int |
BIT_20
precalculated left shift of 1 by 21 places |
private static int |
BIT_23
precalculated left shift of 1 by 24 places |
private static int |
BIT_27
precalculated left shift of 1 by 28 places |
private static int |
BIT_5
mask for bit 5 with 0-based index |
private static int |
BIT_6
mask for bit 6 with 0-based index |
private static int |
BIT_7
mask for bit 7 with 0-based index |
private static java.nio.ByteBuffer |
EMPTY_BUFFER
empty buffer reused for handling null |
(package private) int |
id
the tag id for this TLV tuple |
(package private) int |
index
tlv byte index |
(package private) boolean |
isPrimitive
the flag for whether or not this TLV is constructed or primitive |
(package private) int |
length
the length for this TLV tuple's value field |
(package private) int |
rawTag
the raw tag data |
(package private) TypeClass |
typeClass
the type class for this TLV |
(package private) java.nio.ByteBuffer |
valueChunk
the present value chunk buffer read for this TLV tuple |
(package private) int |
valueIndex
tlv value index for how far into the value we have read |
Constructor Summary | |
---|---|
Tuple()
Empty do nothing tuple. |
|
Tuple(int id,
int length)
Creates constructed application type tlv tuples. |
|
Tuple(int id,
int length,
boolean isPrimitive,
TypeClass typeClass)
Creates constructed application type tlv tuples. |
|
Tuple(int id,
int length,
TypeClass typeClass)
Creates constructed application type tlv tuples. |
|
Tuple(int id,
TypeClass typeClass)
Creates a tuple where the length is indefinite. |
Method Summary | |
---|---|
void |
clear()
Clears the values of this tuple. |
java.lang.Object |
clone()
|
boolean |
equals(java.lang.Object o)
Does not take into account the value, index or the valueIndex values when checking for equality. |
int |
getId()
Gets the tag id for this TLV Tuple. |
java.nio.ByteBuffer |
getLastValueChunk()
Gets the last chunk read for the value field (V-part) for this TLV Tuple. |
int |
getLength()
Gets the value length for this TLV Tuple. |
int |
getLengthLength()
Gets the length in bytes of the length section of this TLV Tuple. |
int |
getRawPrimitiveTag()
Gets the raw tag with the primitive/constructed flag dubbed out. |
int |
getRawTag()
Gets the raw tag as it is stuffed into a primitive int. |
int |
getTagLength()
Gets the length in bytes of the tag section for this TLV tuple. |
TypeClass |
getTypeClass()
Gets the BER TLV TypeClass for this TLV Tuple. |
boolean |
isIndefinite()
Get's whether or not this tuples's length is indefinite. |
boolean |
isIndefiniteTerminator()
Get's whether or not this tuple terminates an indefinite constructed tuple. |
boolean |
isPrimitive()
Gets whether or not this TLV tuple is primitive or constructed. |
void |
setId(int id)
Sets the id of this Tuple and as a side effect the rawTag. |
void |
setLastValueChunk(java.nio.ByteBuffer buf)
Sets the value representing the last chunk read or the last chunch to write. |
void |
setLength(java.nio.ByteBuffer octets,
int lengthBytes)
Sets the length bytes. |
void |
setLength(int length)
|
void |
setRawTag(int rawTag)
Sets the raw tag encoded as a primitive int and as a side effect this call also sets the id, primitive flag, and typeClass of this TLV tuple. |
void |
setTag(java.nio.ByteBuffer octets,
int tagLength)
Sets the tag section within the buffer. |
void |
setTag(TagEnum tag)
Sets the tag parameters using a tag enumeration type. |
void |
setTag(TagEnum tag,
boolean isPrimitive)
Sets the tag parameters using a tag enumeration type explicitly setting the primitive/constructed bit. |
void |
setValueLength(int length)
Sets the value length of this Tuple. |
int |
size()
Gets the total size of this TLV tuple in bytes. |
java.nio.ByteBuffer |
toEncodedBuffer(java.util.List valueChunks)
If this is a primitive TLV then the valueBytes argument is used to produce an encoded image of this TLV. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.nio.ByteBuffer EMPTY_BUFFER
private static final int BIT_5
private static final int BIT_6
private static final int BIT_7
private static final int BIT_13
private static final int BIT_15
private static final int BIT_20
private static final int BIT_23
private static final int BIT_27
int rawTag
int id
boolean isPrimitive
TypeClass typeClass
int length
java.nio.ByteBuffer valueChunk
int index
int valueIndex
Constructor Detail |
---|
public Tuple()
public Tuple(int id, int length)
id
- the tag id of the tlvlength
- the length of the value which is the length of all the
nested tuples.public Tuple(int id, int length, TypeClass typeClass)
id
- the tag id of the tlvlength
- the length of the value which is the length of all the
nested tuples.typeClass
- the type class of this tlv tuplepublic Tuple(int id, int length, boolean isPrimitive, TypeClass typeClass)
id
- the tag id of the tlvlength
- the length of the value which is the length of all the
nested tuples.isPrimitive
- whether or not this Tuple is primitive or constructedtypeClass
- the type class of this tlv tuplepublic Tuple(int id, TypeClass typeClass)
id
- the tag id of the tlvtypeClass
- the type class for the tlvMethod Detail |
---|
public int getId()
public void setId(int id)
id
- the new tag id to setpublic int getRawTag()
public void setRawTag(int rawTag)
rawTag
- the raw primitive int encoded tag.public void setTag(TagEnum tag)
tag
- the tag enumeration constantpublic void setTag(TagEnum tag, boolean isPrimitive)
tag
- the tag enumeration constantisPrimitive
- primitive/constructed bit overridepublic int getRawPrimitiveTag()
public boolean isIndefinite()
public boolean isIndefiniteTerminator()
public boolean isPrimitive()
public int getLength()
public void setLength(int length)
public TypeClass getTypeClass()
public java.nio.ByteBuffer getLastValueChunk()
public void setLastValueChunk(java.nio.ByteBuffer buf)
buf
- the last chunk as a bufferpublic int size()
public void clear()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public java.lang.Object clone()
clone
in class java.lang.Object
public java.nio.ByteBuffer toEncodedBuffer(java.util.List valueChunks)
public void setTag(java.nio.ByteBuffer octets, int tagLength)
octets
- the buffer to set the tag intagLength
- the length of the tag sectionpublic void setValueLength(int length)
length
- the length of this tuple's value.to get the entire determinate length of tuple
public void setLength(java.nio.ByteBuffer octets, int lengthBytes)
octets
- the byte [] to set length inlengthBytes
- the number bytes for the length sectionpublic int getTagLength()
public int getLengthLength()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |