Skip to content

richardstartin/messagepack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

messagepack

Maps streams of objects to messagepack arrays without allocation. Faster and lighter-weight than msgpack-java.

var buffer = ByteBuffer.allocate(BUFFER_SIZE);
var serialiser = new Packer(b -> send(b), buffer);
for (MyMetric myMetric : myMetrics) {
  serialiser.serialise(myMetric, (MyMetric metric, Writable writable) -> {
     writable.writeString("id");
     writable.writeLong(metric.getId());
     writable.writeString("name");
     writable.writeString(metric.getName());
     writable.writeString("value");
     writable.writeDouble(metric.getValue());
     writable.writeString("tags");
     writable.writeMap(metric.getTags());
});
serialiser.flush();

About

a messagepack serialiser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages