A UBJSON lib for Java
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.utils
gradle/wrapper
ubjson-gson
ubjson
.gitignore
.travis.yml
LICENSE.txt
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

UBJSON for Java

Maven Central

Build Status

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();