public static int estimateSizeInBytesUpperBound(byte magic, CompressionType compressionType, byte[] key, byte[] value, Header[] headers) {
        return estimateSizeInBytesUpperBound(magic, compressionType, Utils.wrapNullable(key), Utils.wrapNullable(value), headers);
    }
Get an upper bound estimate on the batch size needed to hold a record with the given fields. This is only
an estimate because it does not take into account overhead from the compression algorithm.
clients/src/main/java/org/apache/kafka/common/record/AbstractRecords.java