public static byte[] encode(List<StreamOffsetRange> streamOffsetRanges) {
        boolean compressed = streamOffsetRanges.size() > COMPRESSION_THRESHOLD;
        int flag = 0;
        if (compressed) {
            flag = flag | ZSTD_COMPRESSED;
        }
        ByteBuf rangesBuf = Unpooled.buffer(streamOffsetRanges.size() * 20);
        streamOffsetRanges.forEach(r -> {
            rangesBuf.writeLong(r.streamId());
            rangesBuf.writeLong(r.startOffset());
            rangesBuf.writeInt((int) (r.endOffset() - r.startOffset()));
        });
        byte[] compressedBytes;
        if (compressed) {
            compressedBytes = Zstd.compress(rangesBuf.array());
        } else {
            compressedBytes = rangesBuf.array();
        }
        ByteBuf buf = Unpooled.buffer(1 /* magic */ + 1 /* flag */ + 4 /* origin size */ + compressedBytes.length);
        buf.writeByte(MAGIC);
        buf.writeByte(flag);
        buf.writeInt(rangesBuf.readableBytes());
        buf.writeBytes(compressedBytes);
        return buf.array();
    }
The order id of the object. Sort by this field to get the order of the objects which contains logically increasing streams.
<p>
When compact a batch of objects to a compacted object, this compacted object's order id will be assigned the value <code>first object's order
id in this batch</code>
metadata/src/main/java/org/apache/kafka/metadata/stream/S3StreamSetObject.java