class DefaultHttp2LocalFlowController implements Http2LocalFlowController {

    @Override
    public boolean consumeBytes(Http2Stream stream, int numBytes) throws Http2Exception {
        assert ctx != null && ctx.executor().inEventLoop();
        checkPositiveOrZero(numBytes, "numBytes");
        if (numBytes == 0) {
            return false;
        }

        // Streams automatically consume all remaining bytes when they are closed, so just ignore
        // if already closed.
        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;
    }

    public  DefaultHttp2LocalFlowController(Http2Connection connection);
    public  DefaultHttp2LocalFlowController(Http2Connection connection,
                                           float windowUpdateRatio,
                                           boolean autoRefillConnectionWindow);

}