A UBJSON lib for Java
Java
Latest commit 8227c54 Sep 21, 2016 @dinocore1 v0.1.5
Permalink
Failed to load latest commit information.
gradle/wrapper initial import Oct 13, 2015
src
.gitignore added license Oct 13, 2015
LICENSE.txt added license Oct 13, 2015
README.md
build.gradle v0.1.5 Sep 21, 2016
gradlew
gradlew.bat initial import Oct 13, 2015
settings.gradle initial import Oct 13, 2015

README.md

UBJSON for Java

Maven Central

Universal Binary JSON is a binary JSON specification designed for ultimate read performance; bringing simplicity, size and performance all together into a single specification that is 100% compatible with JSON.

Write a UBValue to a stream:

UBObject obj = UBValueFactory.createObject();
obj.put("hello", UBValueFactory.createString("world"));
obj.put("array", UBValueFactory.createArray(new int[] {1,2,3}));

ByteArrayOutputStream out = new ByteArrayOutputStream();
UBWriter writer = new UBWriter(out);
writer.write(value);
writer.close();

Read from stream:


UBReader reader = new UBReader(in);

UBValue value = reader.read();
assert(value.isObject());
UBObject obj = value.asObject();
String value = obj.get("hello").asString();

reader.close();