# hpack **Repository Path**: mirrors_tatsuhiro-t/hpack ## Basic Information - **Project Name**: hpack - **Description**: Header Compression for HTTP/2 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-26 - **Last Updated**: 2026-05-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README HPACK [![Build Status](https://travis-ci.org/twitter/hpack.png?branch=master)](https://travis-ci.org/twitter/hpack) ===== [Header Compression for HTTP/2](http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07) ## Download HPACK can be downloaded from the Maven central repository. Add the following dependency section to your pom.xml file: ```xml com.twitter hpack 0.7.0 ``` ## Getting Started This library provides support for compression of header sets into header blocks. The following code fragment demonstrates the use of Encoder and Decoder: try { int maxHeaderSize = 4096; int maxHeaderTableSize = 4096; byte[] name = "name".getBytes(); byte[] value = "value".getBytes(); boolean sensitive = false; ByteArrayOutputStream out = new ByteArrayOutputStream(); // encode header set into header block Encoder encoder = new Encoder(maxHeaderTableSize); encoder.encodeHeader(out, name, value, sensitive); encoder.endHeaders(out); ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); HeaderListener listener = new HeaderListener() { @Override public void emitHeader(byte[] name, byte[] value, boolean sensitive) { // handle header field } }; // decode header block into header set Decoder decoder = new Decoder(maxHeaderSize, maxHeaderTableSize); decoder.decode(in, listener); decoder.endHeaderBlock(listener); } catch (IOException e) { // handle exception } ## Problems? If you find any issues please [report them](https://github.com/twitter/hpack/issues) or better, send a [pull request](https://github.com/twitter/hpack/pulls). ## Authors * Jeff Pinner * Bill Gallagher ## License Copyright 2013 Twitter, Inc. Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0