@Test public void sizeEnforcingInputStream_skipAtLimit() throws IOException { ByteArrayInputStream in = new ByteArrayInputStream("foo".getBytes(Charsets.UTF_8)); SizeEnforcingInputStream stream = new MessageDeframer.SizeEnforcingInputStream(in, 3); long skipped = stream.skip(4); assertEquals(3, skipped); stream.close(); }
@Override public void close() { try { if (unprocessed != null) { unprocessed.close(); } if (nextFrame != null) { nextFrame.close(); } } finally { unprocessed = null; nextFrame = null; } }
MessageDeframer implements Closeable { @Override public void close() { try { if (unprocessed != null) { unprocessed.close(); } if (nextFrame != null) { nextFrame.close(); } } finally { unprocessed = null; nextFrame = null; } } }
MessageDeframer implements Closeable { @Override public void close() { try { if (unprocessed != null) { unprocessed.close(); } if (nextFrame != null) { nextFrame.close(); } } finally { unprocessed = null; nextFrame = null; } } MessageDeframer(Listener listener, Decompressor decompressor, int maxMessageSize); }
MessageDeframer implements Closeable { @Override public void close() { try { if (unprocessed != null) { unprocessed.close(); } if (nextFrame != null) { nextFrame.close(); } } finally { unprocessed = null; nextFrame = null; } } MessageDeframer(Listener listener, Decompressor decompressor, int maxMessageSize); void setDecompressor(Decompressor decompressor); void request(int numMessages); void deframe(ReadableBuffer data, boolean endOfStream); boolean isStalled(); @Override void close(); boolean isClosed(); }
MessageDeframer implements Closeable { @Override public void close() { try { if (unprocessed != null) { unprocessed.close(); } if (nextFrame != null) { nextFrame.close(); } } finally { unprocessed = null; nextFrame = null; } } MessageDeframer(Listener listener, Decompressor decompressor, int maxMessageSize); void setDecompressor(Decompressor decompressor); void request(int numMessages); void deframe(ReadableBuffer data, boolean endOfStream); boolean isStalled(); @Override void close(); boolean isClosed();  }