Giter VIP home page Giter VIP logo

java-qpack's Introduction

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 build the project using maven (mvn >= 3.3 and java 8 are recommended):

mvn clean install -Dgpg.skip

After building the project, grab the target/java-qpack-0.0-SNAPSHOT.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));
    }

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.