airframe-msgpack

airframe-msgpack is a pure-Scala MessagePack reader and writer.

Maven Central

libraryDependencies += "org.wvlet.airframe" %% "airframe-msgpack" % "(version)"

Usage

import wvlet.airframe.msgpack.spi.MessagePack

// Create a packer for writing MessagePack values
val packer = MessagePack.newBufferPacker

packer.packInt(10)
packer.packString("hello")
// ...

// Produce MessagePack byte array
val msgpack = packer.toByteArray


// Create an unpacker for reading MesagePack values 
val unpacker = MessagePack.newUnpacker(msgpack)
unpacker.unpackInt // 10
unpacker.unpackString // String