Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

README.md

binpack-java

The Java implement for binpack.

SPEC: http://binpack.liaohuqiu.net/

usage:

<dependency>
    <groupId>in.srain</groupId>
    <artifactId>binpack</artifactId>
    <version>1.0.1</version>
</dependency>
String strToBs = "All men are created equal.";
Map<String, Object> m = new HashMap<String, Object>();
m.put("abc", 32);
m.put("hello", "You jump, I jump");
m.put("world", strToBs.getBytes("UTF-8"));
m.put("float", 12345.6789E123);

byte[] tmp = BinPack.encode(m, "UTF-8");
Map<String, Object> obj = (Map<String, Object>) BinPack.decode(tmp, "UTF-8");
byte[] bs = (byte[]) obj.get("world");
System.out.println(m);
System.out.println(obj);
System.out.println(new String(bs, "UTF-8").equals(strToBs));

About

No description, website, or topics provided.

Resources

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.