public class Tag
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Tag.TagType
The tag type
|
Modifier and Type | Field and Description |
---|---|
static byte |
APPLICATION |
static byte |
CONTEXT |
static byte |
PRIVATE |
static byte |
UNIVERSAL
The tag classes
|
Constructor and Description |
---|
Tag(byte[] binary,
int offset)
Create a tag from a binary stream.
|
Tag(int tagNumber,
byte tagClass,
Tag.TagType tagType,
int tagSize)
Creates a tag from its attributes.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
byte |
getTagClass()
Gets the tag class
|
int |
getTagNumber()
Gets the tag number
|
int |
getTagSize()
Gets the tag size
|
Tag.TagType |
getTagType()
Gets the tag type
|
int |
hashCode() |
java.lang.String |
toString() |
public static final byte UNIVERSAL
public static final byte APPLICATION
public static final byte CONTEXT
public static final byte PRIVATE
public Tag(int tagNumber, byte tagClass, Tag.TagType tagType, int tagSize)
tagNumber
- the tag value.tagClass
- the tag class.tagType
- constructed or primitivetagSize
- the tag size (1 or 2)public Tag(byte[] binary, int offset)
binary
- the byte array containing the TLV dataoffset
- the start offset in the byte arrayjava.lang.IndexOutOfBoundsException
- if the offset is too largepublic int getTagNumber()
public byte getTagClass()
public Tag.TagType getTagType()
Tag.TagType
enum itempublic int getTagSize()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object