private String readString(ByteBuffer buffer) throws IOException {
            if (!buffer.hasRemaining()) {
                throw new IOException("Hpack read headers failed: data is exhaust");
            }
            int firstByte = readByte(buffer);
            boolean huffmanDecode = (firstByte & 0x80) == 0x80; // 1NNNNNNN
            int length = readInt(buffer, firstByte, PREFIX_7_BITS);
            if (buffer.remaining() < length) {
                throw new IOException("Hpack read headers failed: data not enough, expect: " +
                        length + " actual: " + buffer.remaining());
            }
            byte[] data = new byte[length];
            buffer.get(data);
            return new String(huffmanDecode ? Huffman.get().decode(data) : data);
        }
Read and write HPACK v10.

https://httpwg.org/specs/rfc7540.html#HeaderBlock

This implementation uses an array for the dynamic table and a list for indexed entries.  Dynamic
entries are added to the array, starting in the last position moving forward.  When the array
fills, it is doubled.

@author Megatron King
@since 2019/1/5 20:13
netbare-core/src/main/java/com/github/megatronking/netbare/http2/Hpack.java