private static int check(ByteBuf buf) {
            buf = buf.duplicate();
            int recordCount = 0;
            while (buf.readableBytes() > 0) {
                byte magicCode = buf.readByte();
                if (magicCode != ObjectWriter.DATA_BLOCK_MAGIC) {
                    throw new RuntimeException("[FATAL] magic code mismatch, data is corrupted, expected " + ObjectWriter.DATA_BLOCK_MAGIC + ", actual " + magicCode);
                }
                buf.readByte(); // flag
                recordCount += buf.readInt();
                int dataLength = buf.readInt();
                buf.skipBytes(dataLength);
            }
            return recordCount;
        }
@param dataBlockSize The total size of the data blocks, which equals to index start position.
@param indexBlock    raw index data.
s3stream/src/main/java/com/automq/stream/s3/ObjectReader.java