+ interface SerialForm extends Externalizable {
+ @NonNull LocalHistoryIdentifier identifier();
+
+ void setIdentifier(@NonNull LocalHistoryIdentifier identifier);
+
+ @java.io.Serial
+ Object readResolve();
+
+ @Override
+ default void writeExternal(final ObjectOutput out) throws IOException {
+ final var id = identifier();
+ id.getClientId().writeTo(out);
+ WritableObjects.writeLongs(out, id.getHistoryId(), id.getCookie());
+ }
+
+ @Override
+ default void readExternal(final ObjectInput in) throws IOException {
+ final var clientId = ClientIdentifier.readFrom(in);
+
+ final byte header = WritableObjects.readLongHeader(in);
+ final var historyId = WritableObjects.readFirstLong(in, header);
+ final var cookie = WritableObjects.readSecondLong(in, header);
+ setIdentifier(new LocalHistoryIdentifier(clientId, historyId, cookie));
+ }
+ }
+
+ private static final class Proxy implements SerialForm {
+ @java.io.Serial