public class TLV
extends java.lang.Object
(ITU-T X.690 / ISO 8825)
Constructor and Description |
---|
TLV(byte[] binary)
Create a TLV object initialized with a byte array
|
Modifier and Type | Method and Description |
---|---|
int |
getPosition()
Gets the current position in the main array
|
byte[] |
getValue()
Return a byte array copied from the main array corresponding to value part of the last TLV
parsing.
|
boolean |
parse(Tag tag,
int offset)
Parse the byte array to find the expected TLV.
|
java.lang.String |
toString() |
public TLV(byte[] binary)
binary
- the byte array containing the TLV structurepublic boolean parse(Tag tag, int offset)
The method returns true if the tag is found.
The analysis result is available with getValue and getPosition
tag
- the tag to search in the byte arrayoffset
- the position to start in the byte arraypublic int getPosition()
public java.lang.String toString()
toString
in class java.lang.Object
public byte[] getValue()
This method modifies the global position in the main array. Thus, it must be called once only.