class DefaultHttp2HeadersEncoder implements Http2HeadersEncoder, Http2HeadersEncoder.Configuration {

  @Override
  public void encodeHeaders(final int streamId, final Http2Headers headers, final ByteBuf buffer)
      throws Http2Exception {
    try {
      // If there was a change in the table size, serialize the output from the hpackEncoder
      // resulting from that change.
      if (tableSizeChangeOutput.isReadable()) {
        buffer.writeBytes(tableSizeChangeOutput);
        tableSizeChangeOutput.clear();
      }

      hpackEncoder.encodeHeaders(streamId, buffer, headers, sensitivityDetector);
    } catch (final Http2Exception e) {
      throw e;
    } catch (final Throwable t) {
      throw connectionError(
          Http2Error.COMPRESSION_ERROR, t, "Failed encoding headers block: %s", t.getMessage());
    }
  }

  public  DefaultHttp2HeadersEncoder();
  public  DefaultHttp2HeadersEncoder(final SensitivityDetector sensitivityDetector);
  public  DefaultHttp2HeadersEncoder(
      final SensitivityDetector sensitivityDetector, final boolean ignoreMaxHeaderListSize);
  public  DefaultHttp2HeadersEncoder(
      final SensitivityDetector sensitivityDetector,
      final boolean ignoreMaxHeaderListSize,
      final int dynamicTableArraySizeHint);
    DefaultHttp2HeadersEncoder(
      final SensitivityDetector sensitivityDetector, final HpackEncoder hpackEncoder);

}