Skip to content

TlvException

com.rvi.application.exception.TlvException · Class · SocialCard 1.0.3

Report invalid or unsupported Type 2 Tag TLV layout.

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.

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().

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.

TlvDecoder · TlvDecoder.Header · NDefMessageException

Method signatures in the Javadoc · All API types