byte[] writeRequestHeaders(HttpMethod method, String path, String host,
                                Map<String, List<String>> headers) throws IOException {
            mOut = new ByteArrayOutputStream();
            List<Header> hpackHeaders = new ArrayList<>();
            hpackHeaders.add(new Header(Header.TARGET_METHOD, method.name()));
            hpackHeaders.add(new Header(Header.TARGET_PATH, path));
            hpackHeaders.add(new Header(Header.TARGET_AUTHORITY, host));
            hpackHeaders.add(new Header(Header.TARGET_SCHEME, "https"));
            for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
                if (HTTP_2_SKIPPED_REQUEST_HEADERS.contains(entry.getKey().toLowerCase())) {
                    continue;
                }
                for (String value : entry.getValue()) {
                    hpackHeaders.add(new Header(entry.getKey(), value));
                }
            }
            return writeHeaders(hpackHeaders);
        }
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