DefaultHttp2LocalFlowController implements Http2LocalFlowController { @Override public boolean consumeBytes(Http2Stream stream, int numBytes) throws Http2Exception { assert ctx != null && ctx.executor().inEventLoop(); if (numBytes < 0) { throw new IllegalArgumentException("numBytes must not be negative"); } if (numBytes == 0) { return false; } if (stream != null && !isClosed(stream)) { if (stream.id() == CONNECTION_STREAM_ID) { throw new UnsupportedOperationException("Returning bytes for the connection window is not supported"); } boolean windowUpdateSent = connectionState().consumeBytes(numBytes); windowUpdateSent |= state(stream).consumeBytes(numBytes); return windowUpdateSent; } return false; } DefaultHttp2LocalFlowController(Http2Connection connection);  DefaultHttp2LocalFlowController(Http2Connection connection,
                                           float windowUpdateRatio,
                                           boolean autoRefillConnectionWindow); @Override DefaultHttp2LocalFlowController frameWriter(Http2FrameWriter frameWriter); @Override void channelHandlerContext(ChannelHandlerContext ctx); @Override void initialWindowSize(int newWindowSize); @Override int initialWindowSize(); @Override int windowSize(Http2Stream stream); @Override int initialWindowSize(Http2Stream stream); @Override void incrementWindowSize(Http2Stream stream, int delta); @Override boolean consumeBytes(Http2Stream stream, int numBytes); @Override int unconsumedBytes(Http2Stream stream); void windowUpdateRatio(float ratio); float windowUpdateRatio(); void windowUpdateRatio(Http2Stream stream, float ratio); float windowUpdateRatio(Http2Stream stream); @Override void receiveFlowControlledFrame(Http2Stream stream, ByteBuf data, int padding,
            boolean endOfStream); static final float DEFAULT_WINDOW_UPDATE_RATIO; }
@Test public void consumeBytesForZeroNumBytesShouldIgnore() throws Http2Exception { assertFalse(controller.consumeBytes(connection.stream(STREAM_ID), 0)); }
@Test(expected = IllegalArgumentException.class) public void consumeBytesForNegativeNumBytesShouldFail() throws Http2Exception { assertFalse(controller.consumeBytes(connection.stream(STREAM_ID), -1)); }