public static int crc32(ByteBuf buf, int length) {
        CRC32 crc32 = new CRC32();
        ByteBuf slice = buf.slice(buf.readerIndex(), length);
        for (ByteBuffer buffer : slice.nioBuffers()) {
            crc32.update(buffer);
        }
        return (int) (crc32.getValue() & 0x7FFFFFFF);
    }
Get CRC32 of the given ByteBuf from current reader index to the given length.
This method will not change the reader index of the given ByteBuf.
s3stream/src/main/java/com/automq/stream/s3/wal/util/WALUtil.java