public static ElasticPartitionProducerSnapshotsMeta decode(ByteBuffer buffer) {
        ByteBuf buf = Unpooled.wrappedBuffer(buffer);
        byte magicCode = buf.readByte();
        if (magicCode != MAGIC_CODE) {
            throw new IllegalArgumentException("invalid magic code " + magicCode);
        }
        Map<Long, ByteBuffer> snapshots = new HashMap<>();
        while (buf.readableBytes() != 0) {
            long offset = buf.readLong();
            int length = buf.readInt();
            byte[] snapshot = new byte[length];
            buf.readBytes(snapshot);
            ByteBuffer snapshotBuf = ByteBuffer.wrap(snapshot);
            snapshots.put(offset, snapshotBuf);
        }
        return new ElasticPartitionProducerSnapshotsMeta(snapshots);
    }
refers to all valid snapshot files
core/src/main/scala/kafka/log/streamaspect/ElasticPartitionProducerSnapshotsMeta.java