Skip to content

TlvDecoder.Header

com.rvi.application.TlvDecoder.Header · Private record · SocialCard 1.0.3

Represent the parsed header and declared value length of a tag-memory wrapper.

Call TlvDecoder.encodedLength() when only the TLV header is available. Use decode() after retrieving the bytes the header announced. The private record has no public entry point of its own.

final byte[] shortHeader = { 0x03, 0x10 };
final int total = new TlvDecoder().encodedLength(shortHeader);
System.out.println(total); // 2 header + 16 NDEF + 1 terminator = 19
Java imports
import com.rvi.application.TlvDecoder;

The header alone is sufficient for this size calculation. A complete TLV is required to decode the value.

Header stores headerLength and valueLength. Its totalLength() adds the header size, value bytes and one byte for the terminator. The decoder creates it from a two-byte short header or a four-byte extended header.

TlvDecoder · TlvEncoder · TlvException

TlvDecoder Javadoc · All API types