static int recordSize(byte magic, ByteBuffer key, ByteBuffer value) {
        return recordSize(magic, key == null ? 0 : key.limit(), value == null ? 0 : value.limit());
    }
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