@Test public void largerFrameSize() throws Exception { allocator = new BytesWritableBufferAllocator(0, 10000); framer = new MessageFramer(sink, allocator, statsTraceCtx); writeKnownLength(framer, new byte[1000]); framer.flush(); verify(sink).deliverFrame(frameCaptor.capture(), eq(false), eq(true), eq(1)); ByteWritableBuffer buffer = frameCaptor.getValue(); assertEquals(1005, buffer.size()); byte[] data = new byte[1005]; data[3] = 3; data[4] = (byte) 232; assertEquals(toWriteBuffer(data), buffer); verifyNoMoreInteractions(sink); assertEquals(1, allocator.allocCount); checkStats(1000, 1000); }
@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();  }