Last active
December 1, 2015 10:25
-
-
Save maiha/c8191bed3d9f64bb338f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
libraryDependencies ++= Seq( | |
"com.github.xuwei-k" %% "msgpack4z-core" % "0.2.0", | |
"com.github.xuwei-k" % "msgpack4z-java07" % "0.2.0" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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