|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.asn1.ber.Tag
The Tag component of a BER TLV Tuple.
Field Summary | |
private TagOctetCollector |
buf
buffer backed by a Java int to collect the arriving tag octets |
private static int |
CONSTRUCTED_FLAG
tag flag for the primitive/constructed bit - 0010 0000 - 0x20 |
private static int |
FOUR_OCTET_IDMAX
the max id size with four tag octets |
private int |
id
tag id |
private boolean |
isFixated
whether or not this tag has been fixated |
private boolean |
isPrimitive
whether or not this tag represents a primitive type |
private static int |
LONG_FLAG
tag flag indicating the use of the long tag encoding form |
(package private) static int |
LONG_MASK
tag mask for the long tag format - 0111 1111 - 0x7F |
private static int |
ONE_OCTET_IDMAX
the max id size with one tag octet |
(package private) static int |
SHORT_MASK
tag mask for the short tag format - 0001 1111 - 0x1F |
private static int |
THREE_OCTET_IDMAX
the max id size with three tag octets |
private static int |
TWO_OCTET_IDMAX
the max id size with two tag octets |
private TypeClass |
typeClass
the type class of this tag |
Constructor Summary | |
Tag()
|
Method Summary | |
(package private) void |
add(byte octet)
Adds an octet to this Tag and as a size effect may fixate the Tag if all the expected data has arrived. |
(package private) void |
clear()
Clears this tag's data of all bytes and values calculated so all is as it was when this instance was created. |
(package private) void |
fixate()
Fixates the data within this Tag calculating all the derived properties from the existing set of octets. |
int |
getId()
Gets the id. |
static int |
getIntEncodedTag(TypeClass type,
int id,
boolean isConstructed)
Assembles the Java primitive int based encoding for a tag using a set of parameters. |
byte[] |
getOctets()
Gets a copy of the octets composing this Tag. |
int |
getRawTag()
Gets the raw tag as it is stuffed into a primitive int. |
static int |
getTagId(byte[] octets)
Gets the tag id of a TLV from tag octets. |
static int |
getTagId(int octets)
Gets the tag id of a TLV from tag octets encoded as a Java primitive int. |
static int |
getTagId(TagOctetCollector octets)
Gets the tag id of a TLV from the tag octets. |
TypeClass |
getTypeClass()
Gets the type class for this Tag. |
static boolean |
isConstructed(int octet)
Checks to see if the tag is constructed. |
boolean |
isFixated()
Checks to see if the tag has been fixated. |
boolean |
isPrimitive()
Checks to see if the tag represented by this Tag is primitive or constructed. |
static boolean |
isPrimitive(int octet)
Checks to see if the tag is a primitive. |
static boolean |
isRawTagConstructed(int rawTag)
|
static int |
setIntEncodedId(int encodedTag,
int id)
Sets the id of a tag encoded as a Java primitive integer. |
int |
size()
Gets the number of octets in this Tag. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int CONSTRUCTED_FLAG
static final int SHORT_MASK
static final int LONG_MASK
private static final int LONG_FLAG
private static final int ONE_OCTET_IDMAX
private static final int TWO_OCTET_IDMAX
private static final int THREE_OCTET_IDMAX
private static final int FOUR_OCTET_IDMAX
private int id
private boolean isPrimitive
private boolean isFixated
private TypeClass typeClass
private final TagOctetCollector buf
Constructor Detail |
public Tag()
Method Detail |
void clear()
void fixate() throws org.apache.asn1.codec.DecoderException
org.apache.asn1.codec.DecoderException
- if this Tag is invalidvoid add(byte octet) throws org.apache.asn1.codec.DecoderException
octet
- the 8 bit byte to add
org.apache.asn1.codec.DecoderException
public byte[] getOctets()
public int size()
public int getId()
public int getRawTag()
public boolean isPrimitive()
public boolean isFixated()
public TypeClass getTypeClass()
public static final int setIntEncodedId(int encodedTag, int id)
encodedTag
- the tag encoded as a Java primitive integerid
- the new tag id to set within the encodedTag
public static final int getIntEncodedTag(TypeClass type, int id, boolean isConstructed)
type
- id
- isConstructed
-
public static final int getTagId(byte[] octets) throws org.apache.asn1.codec.DecoderException
octets
- the set of octets needed to determine the tag value
(a.k.a identifier octets)
org.apache.asn1.codec.DecoderException
- if the id cannot be determined due to
type limitations of this method's return type.public static final int getTagId(int octets)
octets
- the tag octets encoded as a Java primitive int
public static final int getTagId(TagOctetCollector octets)
octets
- the set of octets needed to determine the tag value
(a.k.a identifier octets)
public static final boolean isPrimitive(int octet)
octet
- the first octet of the tag
public static final boolean isConstructed(int octet)
octet
- the first octet of the tag
public static boolean isRawTagConstructed(int rawTag)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |