TlvException
com.rvi.application.exception.TlvException · Class · SocialCard 1.0.3
Report invalid or unsupported Type 2 Tag TLV layout.
When to use it
Section titled “When to use it”Catch it when decoding an external tag image or reading a tag whose layout is unknown. Check that the data starts at the NDEF TLV and that the declared length and terminator are present.
Java example
Section titled “Java example”final byte[] incompleteTlv = { 0x03, 0x05 };try { new TlvDecoder().decode(incompleteTlv);} catch (final TlvException failure) { System.err.println(failure.getMessage()); // TLV length exceeds the available data}Java imports
import com.rvi.application.TlvDecoder;import com.rvi.application.exception.TlvException;For incremental reads, use encodedLength() to compute the required total before calling decode().
How it works
Section titled “How it works”TlvDecoder checks the type byte, one-byte or extended length, value bounds and trailing 0xFE. An empty NDEF TLV is also rejected by decode(). A structurally invalid NDEF message inside a valid wrapper can raise NDefMessageException separately.