public static int recordSize(byte magic, int keySize, int valueSize) {
        return recordOverhead(magic) + keySize + valueSize;
    }
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