Repository: netty/netty
Issue: Expose the hpack decoder

Hello,

grpc is using the hpack decoder in [GrpcHttp2HeadersDecoder](https://github.com/grpc/grpc-java/blob/master/netty/src/main/java/io/grpc/netty/GrpcHttp2HeadersDecoder.java) and in netty 4.1.9.Final its visibility has been [changed to private](https://github.com/zer0se7en/netty/pull/2/commits/f9001b9fc07a71a9d6eaf0462470416780302107).
This is preventing grpc to be used with netty 4.1.9.Final and with netty-tcnative 2.0.0.Final.

Would it be possible to expose back this feature to the public api?

Thank you,

Reference discussion: https://groups.google.com/forum/#!topic/grpc-io/jkgIbSC9PlI


Issue comments:
@nmittler @ejona86 can we get around this without exposing it again ? 
I'll defer to @ejona86 and @carl-mastrangelo 
I just chatted with @carl-mastrangelo offline and this is blocking them from migrating to 4.1.9.Final.  Easiest thing would be to just expose it.

@Scottmitch any objections?
FYI: we (gRPC Team) don't mind too much working around breaking method signatures and moving code.  We accept that the HTTP/2 API is unstable.  
Thanks everyone for working on this. I'm really existed to use this when released.
@guillaumecle - Just to clarify your end goal is just to use gRPC after it has consumed a new version of Netty, not necessarily directly using the HPACK classes, correct?

I would like to avoid exposing HPACK if possible (see https://github.com/netty/netty/issues/6591)
Correct, especially use cloud-bigtable-client after it has consumed new versions of gRPC and Netty.
We are really eager to consume this fix, any idea of when Netty 4.1.10.Final will be released?
@guillaumecle end of this week.

Pull request review comments:
if we make it public again can we at least make it final ?
Yup - done. I wasn't sure at first whether gRPC needed to extend but it looks like it doesn't.
having this be public can be dangerous as indicated in the comments. Can this stay package private?

Patch that resolved the issue:
diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDecoder.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDecoder.java
index dad2c6fc1d8..e4d5c5f0d4d 100644
--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDecoder.java
+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDecoder.java
@@ -49,7 +49,7 @@
 import static io.netty.util.internal.ObjectUtil.checkPositive;
 import static io.netty.util.internal.ThrowableUtil.unknownStackTrace;
 
-final class HpackDecoder {
+public final class HpackDecoder {
     private static final Http2Exception DECODE_ULE_128_DECOMPRESSION_EXCEPTION = unknownStackTrace(
             connectionError(COMPRESSION_ERROR, "HPACK - decompression failure"), HpackDecoder.class,
             "decodeULE128(..)");
@@ -96,7 +96,7 @@ final class HpackDecoder {
      *  (which is dangerous).
      * @param initialHuffmanDecodeCapacity Size of an intermediate buffer used during huffman decode.
      */
-    HpackDecoder(long maxHeaderListSize, int initialHuffmanDecodeCapacity) {
+    public HpackDecoder(long maxHeaderListSize, int initialHuffmanDecodeCapacity) {
         this(maxHeaderListSize, initialHuffmanDecodeCapacity, DEFAULT_HEADER_TABLE_SIZE);
     }
 
@@ -104,7 +104,7 @@ final class HpackDecoder {
      * Exposed Used for testing only! Default values used in the initial settings frame are overriden intentionally
      * for testing but violate the RFC if used outside the scope of testing.
      */
-    HpackDecoder(long maxHeaderListSize, int initialHuffmanDecodeCapacity, int maxHeaderTableSize) {
+    public HpackDecoder(long maxHeaderListSize, int initialHuffmanDecodeCapacity, int maxHeaderTableSize) {
         this.maxHeaderListSize = checkPositive(maxHeaderListSize, "maxHeaderListSize");
         this.maxHeaderListSizeGoAway = Http2CodecUtil.calculateMaxHeaderListSizeGoAway(maxHeaderListSize);
 


Test patch: