DefaultHttp2HeadersEncoder implements Http2HeadersEncoder, Http2HeadersEncoder.Configuration { @Override public void encodeHeaders(int streamId, Http2Headers headers, ByteBuf buffer) throws Http2Exception { try { if (tableSizeChangeOutput.isReadable()) { buffer.writeBytes(tableSizeChangeOutput); tableSizeChangeOutput.clear(); } hpackEncoder.encodeHeaders(streamId, buffer, headers, sensitivityDetector); } catch (Http2Exception e) { throw e; } catch (Throwable t) { throw connectionError(COMPRESSION_ERROR, t, "Failed encoding headers block: %s", t.getMessage()); } } DefaultHttp2HeadersEncoder();  DefaultHttp2HeadersEncoder(SensitivityDetector sensitivityDetector);  DefaultHttp2HeadersEncoder(SensitivityDetector sensitivityDetector, boolean ignoreMaxHeaderListSize);  DefaultHttp2HeadersEncoder(SensitivityDetector sensitivityDetector, boolean ignoreMaxHeaderListSize,
                                      int dynamicTableArraySizeHint);   DefaultHttp2HeadersEncoder(SensitivityDetector sensitivityDetector, HpackEncoder hpackEncoder); @Override void encodeHeaders(int streamId, Http2Headers headers, ByteBuf buffer); @Override void maxHeaderTableSize(long max); @Override long maxHeaderTableSize(); @Override void maxHeaderListSize(long max); @Override long maxHeaderListSize(); @Override Configuration configuration();  }
@Test public void encodeShouldSucceed() throws Http2Exception { Http2Headers headers = headers(); ByteBuf buf = Unpooled.buffer(); try { encoder.encodeHeaders(3 , headers, buf); assertTrue(buf.writerIndex() > 0); } finally { buf.release(); } }