ReaderRepository
com.rvi.application.ReaderRepository · Class · SocialCard 1.0.3
Translate validated NDEF messages into reads and writes on a PC/SC card channel.
When to use it
Section titled “When to use it”Use ReaderService for the full connection lifecycle. Construct this repository only when your integration already owns an appropriate CardChannel. Call read() for a validated message and write(message) to replace it.
Java example
Section titled “Java example”static List<String> readLinks(final CardChannel channel) throws CardException { final IReaderRepository repository = new ReaderRepository(channel); return new NDefDecoder().decodeURIs(repository.read());}Java imports
import com.rvi.application.IReaderRepository;import com.rvi.application.NDefDecoder;import com.rvi.application.ReaderRepository;import java.util.List;import javax.smartcardio.CardChannel;import javax.smartcardio.CardException;This method receives an existing channel. The caller retains responsibility for the connection.
How it works
Section titled “How it works”The repository reads the capability container and checks access and bounds. Writes use four-byte pages. It marks the first page as an incomplete write, updates subsequent pages and clears stale bytes, then publishes the first page and verifies the message by reading it back.
Related API
Section titled “Related API”IReaderRepository · ReaderService · TlvEncoder · TlvDecoder · CardCapacityException