@Test public void frameHeaderSplitBetweenSinks() { allocator = new BytesWritableBufferAllocator(12, 12); framer = new MessageFramer(sink, allocator, statsTraceCtx); writeKnownLength(framer, new byte[]{3, 14, 1}); writeKnownLength(framer, new byte[]{3}); verify(sink).deliverFrame( toWriteBuffer(new byte[] {0, 0, 0, 0, 3, 3, 14, 1, 0, 0, 0, 0}), false, false, 2); verifyNoMoreInteractions(sink); framer.flush(); verify(sink).deliverFrame(toWriteBufferWithMinSize(new byte[] {1, 3}, 12), false, true, 0); verifyNoMoreInteractions(sink); assertEquals(2, allocator.allocCount); checkStats(3, 3, 1, 1); }
@Override public void flush() { if (buffer != null && buffer.readableBytes() > 0) { commitToSink(false, true); } }
MessageFramer implements Framer { @Override public void flush() { if (buffer != null && buffer.readableBytes() > 0) { commitToSink(false, true); } } }
MessageFramer implements Framer { @Override public void flush() { if (buffer != null && buffer.readableBytes() > 0) { commitToSink(false, true); } } MessageFramer(
      Sink sink, WritableBufferAllocator bufferAllocator, StatsTraceContext statsTraceCtx); }
MessageFramer implements Framer { @Override public void flush() { if (buffer != null && buffer.readableBytes() > 0) { commitToSink(false, true); } } MessageFramer(
      Sink sink, WritableBufferAllocator bufferAllocator, StatsTraceContext statsTraceCtx); @Override MessageFramer setCompressor(Compressor compressor); @Override MessageFramer setMessageCompression(boolean enable); @Override void setMaxOutboundMessageSize(int maxSize); @Override void writePayload(InputStream message); @Override void flush(); @Override boolean isClosed(); @Override void close(); @Override void dispose(); }
MessageFramer implements Framer { @Override public void flush() { if (buffer != null && buffer.readableBytes() > 0) { commitToSink(false, true); } } MessageFramer(
      Sink sink, WritableBufferAllocator bufferAllocator, StatsTraceContext statsTraceCtx); @Override MessageFramer setCompressor(Compressor compressor); @Override MessageFramer setMessageCompression(boolean enable); @Override void setMaxOutboundMessageSize(int maxSize); @Override void writePayload(InputStream message); @Override void flush(); @Override boolean isClosed(); @Override void close(); @Override void dispose();  }