Skip to content

MessagePack serializer implementation for Scala / msgpack.org[Scala]

Notifications You must be signed in to change notification settings

zeitos/msgpack-scala

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MessagePack for Scala

Build Status

An implementation of MessagePack for Scala.

Requirement

  • sbt 0.13.5 or later

SBT

Add dependency.

libraryDependencies += "org.msgpack" %% "msgpack-scala" % "0.6.11"

For developer

Make intellij project

>= IntelliJ IDEA 13

You can import sbt file.

< IntelliJ IDEA 13

Please type the following command.Then intellij project will be generated.

$ sbt gen-idea

Quick Start

Serialize/Deserialize class

import org.msgpack.annotation.Message
import org.msgpack.ScalaMessagePack

@Message // Don't forget to add Message annotation.
class YourClass{
  var name : String = ""
  var age : Int = 2
}

val obj = new YourClass()
obj.name = "hoge"
obj.age = 22
val serialized : Array[Byte] = ScalaMessagePack.write(obj)

val deserialized : YourClass = ScalaMessagePack.read[YourClass](serialized)
  • Sorry, case classes are not supported now.

About

MessagePack serializer implementation for Scala / msgpack.org[Scala]

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 100.0%