@Test
void testDecodeWithArrayOffset() throws Exception {

    String value = "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==";
    HpackDecoder decoder = new HpackDecoder(4096, 8192);
    String encoded = "8682418cF1E3C2E5F23a6bA0Ab90F4Ff841f0822426173696320515778685a475270626a70766347567549484e6c633246745a513d3d";
    byte[] bytes = TypeUtils.fromHexString(encoded);
    byte[] array = new byte[bytes.length + 1];
    System.arraycopy(bytes, 0, array, 1, bytes.length);
    ByteBuffer buffer = ByteBuffer.wrap(array, 1, bytes.length).slice();
    MetaData.Request request = (MetaData.Request) decoder.decode(buffer);
    assertEquals("GET", request.getMethod());
    assertEquals(HttpScheme.HTTP.getValue(), request.getURI().getScheme());
    assertEquals("/", request.getURI().getPath());
    assertEquals("www.example.com", request.getURI().getHost());
    assertEquals(1, request.getFields().size());
    HttpField field = request.iterator().next();
    assertEquals(HttpHeader.AUTHORIZATION, field.getHeader());
    assertEquals(value, field.getValue());
}