Matthias Andreas Benkard | 4e8423d | 2021-12-19 22:56:09 +0100 | [diff] [blame^] | 1 | package eu.mulk.jgvariant.ostree; |
| 2 | |
| 3 | import eu.mulk.jgvariant.core.Decoder; |
| 4 | import java.nio.ByteOrder; |
| 5 | |
| 6 | /** |
| 7 | * A fallback entry in a {@link DeltaSuperblock}. |
| 8 | * |
| 9 | * <p>Reference: {@code ostree-repo-static-delta-private.h#OSTREE_STATIC_DELTA_FALLBACK_FORMAT} |
| 10 | */ |
| 11 | public record DeltaFallback( |
| 12 | byte objectType, Checksum checksum, long compressedSize, long uncompressedSize) { |
| 13 | |
| 14 | private static final Decoder<DeltaFallback> DECODER = |
| 15 | Decoder.ofStructure( |
| 16 | DeltaFallback.class, |
| 17 | Decoder.ofByte(), |
| 18 | Checksum.decoder(), |
| 19 | Decoder.ofLong().withByteOrder(ByteOrder.LITTLE_ENDIAN), // FIXME: non-canonical |
| 20 | Decoder.ofLong().withByteOrder(ByteOrder.LITTLE_ENDIAN)); // FIXME: non-canonical |
| 21 | |
| 22 | public static Decoder<DeltaFallback> decoder() { |
| 23 | return DECODER; |
| 24 | } |
| 25 | } |