public static long write(DataOutputStream out,
                             byte magic,
                             long timestamp,
                             byte[] key,
                             byte[] value,
                             CompressionType compressionType,
                             TimestampType timestampType) throws IOException {
        return write(out, magic, timestamp, wrapNullable(key), wrapNullable(value), compressionType, timestampType);
    }
Write the record data with the given compression type and return the computed crc.

@param out The output stream to write to
@param magic The magic value to be used
@param timestamp The timestamp of the record
@param key The record key
@param value The record value
@param compressionType The compression type
@param timestampType The timestamp type
@return the computed CRC for this record.
@throws IOException for any IO errors writing to the output stream.
clients/src/main/java/org/apache/kafka/common/record/LegacyRecord.java