public int sizeInBytes() {
        return buffer.limit();
    }
The complete serialized size of this record in bytes (including crc, header attributes, etc), but
excluding the log overhead (offset and record size).
@return the size in bytes
clients/src/main/java/org/apache/kafka/common/record/LegacyRecord.java