class DefaultHttp2FrameReader implements Http2FrameReader, Http2FrameSizePolicy, Configuration {

  @Override
  public void readFrame(
      final ChannelHandlerContext ctx, final ByteBuf input, final Http2FrameListener listener)
      throws Http2Exception {
    if (readError) {
      input.skipBytes(input.readableBytes());
      return;
    }
    try {
      do {
        if (readingHeaders) {
          processHeaderState(input);
          if (readingHeaders) {
            // Wait until the entire header has arrived.
            return;
          }
        }

        // The header is complete, fall into the next case to process the payload.
        // This is to ensure the proper handling of zero-length payloads. In this
        // case, we don't want to loop around because there may be no more data
        // available, causing us to exit the loop. Instead, we just want to perform
        // the first pass at payload processing now.
        processPayloadState(ctx, input, listener);
        if (!readingHeaders) {
          // Wait until the entire payload has arrived.
          return;
        }
      } while (input.isReadable());
    } catch (final Http2Exception e) {
      readError = !Http2Exception.isStreamError(e);
      throw e;
    } catch (final RuntimeException e) {
      readError = true;
      throw e;
    } catch (final Throwable cause) {
      readError = true;
      PlatformDependent.throwException(cause);
    }
  }

  public  DefaultHttp2FrameReader();
  public  DefaultHttp2FrameReader(final boolean validateHeaders);
  public  DefaultHttp2FrameReader(final Http2HeadersDecoder headersDecoder);

}