Skip to content

Instantly share code, notes, and snippets.

@maiha
Last active December 1, 2015 10:25
Show Gist options
  • Save maiha/c8191bed3d9f64bb338f to your computer and use it in GitHub Desktop.
Save maiha/c8191bed3d9f64bb338f to your computer and use it in GitHub Desktop.
libraryDependencies ++= Seq(
"com.github.xuwei-k" %% "msgpack4z-core" % "0.2.0",
"com.github.xuwei-k" % "msgpack4z-java07" % "0.2.0"
)
import msgpack4z._
import msgpack4z.CodecInstances.all._
val codec = MsgpackCodec[Map[String, MsgpackUnion]]
import java.nio.file.{Files, Paths}
val bytes: Array[Byte] = Files.readAllBytes(Paths.get("test.msgpack"))
val unpacker = Msgpack07Unpacker.defaultUnpacker(bytes)
val result = codec.unpackAndClose(unpacker)
val map = result.toOption.get
map.keys
// Iterable[String] = Set(video_array, device)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment