Skip to content

binpack/binpack-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages