Skip to content

NDefMessageException

com.rvi.domain.exception.NDefMessageException · Class · SocialCard 1.0.3

Report invalid NDEF bytes or a payload the decoder cannot represent.

Catch it when constructing a message from external bytes or interpreting data read from a tag. Keep the raw bytes for debugging if appropriate, and treat an unfamiliar payload as a format problem.

try {
new NDefMessage(new byte[] { (byte) 0xD1, 0x01 });
} catch (final NDefMessageException failure) {
System.err.println(failure.getMessage());
}
Java imports
import com.rvi.domain.NDefMessage;
import com.rvi.domain.exception.NDefMessageException;

This byte sequence contains a truncated record header. Use the encoder or message builder to produce well-formed bytes.

NDefMessage checks the structure and supported record shapes at construction. NDefDecoder.decode() performs further validation when it parses values, such as vCard properties or Wi-Fi credential attributes. A message can pass the first check and fail the second.

NDefMessage · NDefDecoder · TlvDecoder · NDefValueException

Method signatures in the Javadoc · All API types