Skip to content

tristannottelman/java-qpack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QPack Java

QPack is a fast and efficient serialization format like MessagePack. One key difference is flexible map and array support which allows to write directly to a qpack buffer without the need to know the size for the map or array beforehand.

Installation

You can download the latest version here. But you can also clone this repository and open the project in your favorite Java IDE. After building the project, grab the java-qpack.jar file and add it to your own project as library.

Pack


Create an instance of QPack and use its pack method

qpack.pack(Object data);

Unpack

When unpack is called with only the first parameter, each String will be returned as bytes.

qpack.unpack(byte[] qp, String decoder);

Example

package qpack-test

import java.util.Arrays;
import transceptor.technology.QPack;

public class QPackTest() {

    public static void main() {
        QPack qpack = new QPack();

        String[] data = new String[]{"test", "qpack", "Java"};

        byte[] qp = qpack.pack(data);

        Object[] result = (Object[]) qpack.unpack(qp, "utf-8");

        System.out.println(Arrays.toString(result));
    }

}

About

Java QPack library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%