public void sendBuffer(Buffer buffer, int targetChannel) throws IOException, InterruptedException {
this.deserializer.setNextMemorySegment(MockEnvironment.this.mockBuffer.getMemorySegment(), MockEnvironment.this.mockBuffer.size());
while (this.deserializer.hasUnfinishedData()) {
DeserializationResult result = this.deserializer.getNextRecord(this.record);
if (result.isFullRecord()) {
this.out.add(this.record.createCopy());
}
if (result == DeserializationResult.LAST_RECORD_FROM_BUFFER ||
result == DeserializationResult.PARTIAL_RECORD) {