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.
When to use it
Section titled “When to use it”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.
Java example
Section titled “Java example”final byte[] shortHeader = { 0x03, 0x10 };final int total = new TlvDecoder().encodedLength(shortHeader);
System.out.println(total); // 2 header + 16 NDEF + 1 terminator = 19Java imports
import com.rvi.application.TlvDecoder;The header alone is sufficient for this size calculation. A complete TLV is required to decode the value.
How it works
Section titled “How it works”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.