private static long crc32(ByteBuffer buffer, int offset, int size) {
        CRC32 crc = new CRC32();
        Checksums.update(crc, buffer, offset, size);
        return crc.getValue();
    }
Write a record using raw fields (without validation). This should only be used in testing.
clients/src/main/java/org/apache/kafka/common/record/LegacyRecord.java