+ interface SerialForm extends TransactionRequest.SerialForm<SkipTransactionsRequest> {
+ @Override
+ default SkipTransactionsRequest readExternal(final ObjectInput in, final TransactionIdentifier target,
+ final long sequence, final ActorRef replyTo) throws IOException {
+ final int size = in.readInt();
+ final var builder = ImmutableList.<UnsignedLong>builderWithExpectedSize(size);
+ int idx;
+ if (size % 2 != 0) {
+ builder.add(UnsignedLong.fromLongBits(WritableObjects.readLong(in)));
+ idx = 1;
+ } else {
+ idx = 0;
+ }
+ for (; idx < size; idx += 2) {
+ final byte hdr = WritableObjects.readLongHeader(in);
+ builder.add(UnsignedLong.fromLongBits(WritableObjects.readFirstLong(in, hdr)));
+ builder.add(UnsignedLong.fromLongBits(WritableObjects.readSecondLong(in, hdr)));
+ }
+
+ return new SkipTransactionsRequest(target, sequence, replyTo, builder.build());
+ }
+
+ @Override
+ default void writeExternal(final ObjectOutput out, final SkipTransactionsRequest msg) throws IOException {
+ TransactionRequest.SerialForm.super.writeExternal(out, msg);
+
+ final var others = msg.others;
+ final int size = others.size();
+ out.writeInt(size);
+
+ int idx;
+ if (size % 2 != 0) {
+ WritableObjects.writeLong(out, others.get(0).longValue());
+ idx = 1;
+ } else {
+ idx = 0;
+ }
+ for (; idx < size; idx += 2) {
+ WritableObjects.writeLongs(out, others.get(idx).longValue(), others.get(idx + 1).longValue());
+ }
+ }
+ }
+
+ @java.io.Serial