class DefaultHttp2HeadersDecoder implements Http2HeadersDecoder, Http2HeadersDecoder.Configuration {

  @Override
  public Http2Headers decodeHeaders(final int streamId, final ByteBuf headerBlock)
      throws Http2Exception {
    try {
      final Http2Headers headers = newHeaders();
      hpackDecoder.decode(streamId, headerBlock, headers, validateHeaders);
      headerArraySizeAccumulator =
          HEADERS_COUNT_WEIGHT_NEW * headers.size()
              + HEADERS_COUNT_WEIGHT_HISTORICAL * headerArraySizeAccumulator;
      return headers;
    } catch (final Http2Exception e) {
      throw e;
    } catch (final Throwable e) {
      // Default handler for any other types of errors that may have occurred. For example,
      // the Header builder throws IllegalArgumentException if the key or value was invalid
      // for any reason (e.g. the key was an invalid pseudo-header).
      throw connectionError(Http2Error.COMPRESSION_ERROR, e, e.getMessage());
    }
  }

  public  DefaultHttp2HeadersDecoder();
  public  DefaultHttp2HeadersDecoder(final boolean validateHeaders);
  public  DefaultHttp2HeadersDecoder(final boolean validateHeaders, final long maxHeaderListSize);
  public  DefaultHttp2HeadersDecoder(
      final boolean validateHeaders,
      final long maxHeaderListSize,
      final int initialHuffmanDecodeCapacity);
    DefaultHttp2HeadersDecoder(final boolean validateHeaders, final HpackDecoder hpackDecoder);

}