public class SimpleElement extends TlvElement
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 and Description |
|---|
SimpleElement(int identifier,
byte[] buffer) |
SimpleElement(int identifier,
byte[] buffer,
int offset,
int length) |
| Modifier and Type | Method and Description |
|---|---|
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) |
getContent, getContentAt, getIdentifier, getLength, getTemplate, toStringpublic SimpleElement(int identifier,
byte[] buffer)
public SimpleElement(int identifier,
byte[] buffer,
int offset,
int length)
public static SimpleElement parseElement(byte[] encoded, int offset, int length) throws IOException
IOExceptionpublic static TlvTemplate parseTemplate(byte[] encoded, int offset, int length) throws IOException
IOExceptionpublic TlvInputStream createTlvInputStream(byte[] pBytes, int pOffset, int pLength) throws TlvFormatException
createTlvInputStream in class TlvElementTlvFormatExceptionpublic byte[] getEncoded()
TlvElementgetEncoded in class TlvElementpublic boolean isComposite()
TlvElementtrue if this element contains TLV data itself.isComposite in class TlvElementtrue if this element contains TLV data itself.Copyright © 2013 intarsys consulting GmbH. All Rights Reserved.