@Override
    public int writeTo(TransferableChannel channel, int position, int length) throws IOException {
        if (((long) position) + length > buffer.limit())
            throw new IllegalArgumentException("position+length should not be greater than buffer.limit(), position: "
                    + position + ", length: " + length + ", buffer.limit(): " + buffer.limit());
        return Utils.tryWriteTo(channel, position, length, buffer);
    }
Represents a memory record set which is not necessarily offset-aligned
clients/src/main/java/org/apache/kafka/common/record/UnalignedMemoryRecords.java