@Override
    public int sizeInBytes() {
        return buffer.limit();
    }
A {@link Records} implementation backed by a ByteBuffer. This is used only for reading or
modifying in-place an existing buffer of record batches. To create a new buffer see {@link MemoryRecordsBuilder},
or one of the {@link #builder(ByteBuffer, byte, Compression, TimestampType, long)} variants.
clients/src/main/java/org/apache/kafka/common/record/MemoryRecords.java