Skip to content

Instantly share code, notes, and snippets.

@okram
Last active December 15, 2015 18:19
Show Gist options
  • Save okram/5303171 to your computer and use it in GitHub Desktop.
Save okram/5303171 to your computer and use it in GitHub Desktop.
public static void write(final Map<String, Object> properties, final DataOutput out) throws IOException {
if (null == properties) {
WritableUtils.writeVInt(out, 0);
} else {
WritableUtils.writeVInt(out, properties.size());
com.thinkaurelius.titan.graphdb.database.serialize.DataOutput o = s.getDataOutput(128, true);
for (final Map.Entry<String, Object> entry : properties.entrySet()) {
o.putString(entry.getKey());
o.writeClassAndObject(entry.getValue());
}
out.write(o.getByteBuffer().array());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment