package com.dangerousthings.aliro; /** * Minimal write-side abstraction matching the shape of the GlobalPlatform * Amendment H {@code org.globalplatform.upgrade.Element} write API. The * AMD-H adapter (added in a later epic, J3R452-only) is a one-class bridge * that implements this interface against the real {@code Element}. * *

Keeping the interface in the main source tree means * {@link CredentialStore#writeTo(SerializationSink)} can be authored, * tested, and locked down today without pulling in the AMD-H package, which * only exists on JCOP 4.5 / J3R452-class cards. * *

Element semantics: once a byte[] reference is written, the storage * provider treats it as immutable from the caller's perspective. Test * fakes that buffer writes should make defensive copies to mirror this. */ interface SerializationSink { SerializationSink write(byte b); SerializationSink write(short s); SerializationSink write(boolean z); SerializationSink write(byte[] arr); }