DefaultHttp2LocalFlowController implements Http2LocalFlowController { @Override public void receiveFlowControlledFrame(Http2Stream stream, ByteBuf data, int padding, boolean endOfStream) throws Http2Exception { assert ctx != null && ctx.executor().inEventLoop(); int dataLength = data.readableBytes() + padding; FlowState connectionState = connectionState(); connectionState.receiveFlowControlledFrame(dataLength); if (stream != null && !isClosed(stream)) { FlowState state = state(stream); state.endOfStream(endOfStream); state.receiveFlowControlledFrame(dataLength); } else if (dataLength > 0) { connectionState.consumeBytes(dataLength); } } 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 dataFrameShouldBeAccepted() throws Http2Exception { receiveFlowControlledFrame(STREAM_ID, 10, 0, false); verifyWindowUpdateNotSent(); }
@Test(expected = Http2Exception.class) public void connectionFlowControlExceededShouldThrow() throws Http2Exception { receiveFlowControlledFrame(STREAM_ID, DEFAULT_WINDOW_SIZE, 1, true); }