|
intarsys runtime library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.intarsys.tools.tlv.common.TlvElement
de.intarsys.tools.tlv.common.SimpleElement
public class SimpleElement
Implementation of a simple TLV object.
Each SIMPLE-TLV data object shall consist of two or three consecutive fields: a mandatory tag field, a mandatory length field and a conditional value field.
The tag field consists of a single byte encoding a tag number from 1 to 254. The values '00' and 'FF' are invalid for tag fields.
The length field consists of one or three consecutive bytes. - If the first byte is not set to 'FF', then the length field consists of a single byte encoding a number from zero to 254 and denoted N. - If the first byte is set to 'FF', then the length field continues on the subsequent two bytes with any value encoding a number from zero to 65 535 and denoted N.
If N is zero, there is no value field, i.e., the data object is empty. Otherwise (N > 0), the value field consists of N consecutive bytes.
| Constructor Summary | |
|---|---|
SimpleElement(int identifier,
byte[] buffer)
|
|
SimpleElement(int identifier,
byte[] buffer,
int offset,
int length)
|
|
| Method Summary | |
|---|---|
TlvInputStream |
createTlvInputStream(byte[] pBytes,
int pOffset,
int pLength)
|
byte[] |
getEncoded()
The whole, encoded TLV element. |
boolean |
isComposite()
true if this element contains TLV data itself. |
static SimpleElement |
parseElement(byte[] encoded,
int offset,
int length)
|
static TlvTemplate |
parseTemplate(byte[] encoded,
int offset,
int length)
|
| Methods inherited from class de.intarsys.tools.tlv.common.TlvElement |
|---|
getContent, getIdentifier, getLength, getTemplate, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleElement(int identifier,
byte[] buffer)
public SimpleElement(int identifier,
byte[] buffer,
int offset,
int length)
| Method Detail |
|---|
public static SimpleElement parseElement(byte[] encoded,
int offset,
int length)
throws IOException
IOException
public static TlvTemplate parseTemplate(byte[] encoded,
int offset,
int length)
throws IOException
IOException
public TlvInputStream createTlvInputStream(byte[] pBytes,
int pOffset,
int pLength)
throws TlvFormatException
createTlvInputStream in class TlvElementTlvFormatExceptionpublic byte[] getEncoded()
TlvElement
getEncoded in class TlvElementpublic boolean isComposite()
TlvElementtrue if this element contains TLV data itself.
isComposite in class TlvElementtrue if this element contains TLV data itself.
|
intarsys runtime library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||