https://github.com/edadma/ubjson
an implementation of the Universal Binary JSON (UBJSON) computer data interchange format for Scala
https://github.com/edadma/ubjson
json scala ubjson
Last synced: about 1 month ago
JSON representation
an implementation of the Universal Binary JSON (UBJSON) computer data interchange format for Scala
- Host: GitHub
- URL: https://github.com/edadma/ubjson
- Owner: edadma
- License: isc
- Created: 2018-03-27T21:43:37.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-09-01T01:47:10.000Z (almost 7 years ago)
- Last Synced: 2025-07-30T14:26:09.981Z (11 months ago)
- Topics: json, scala, ubjson
- Language: Scala
- Size: 24.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ubjson
======
[](https://www.travis-ci.org/edadma/ubjson)
[](https://ci.appveyor.com/project/edadma/ubjson/branch/master)
[](https://coveralls.io/github/edadma/ubjson?branch=master)
[](https://opensource.org/licenses/ISC)
[](https://www.scala-sbt.org/)
*ubjson* is an implementation of the [Universal Binary JSON](http://ubjson.org/) (UBJSON) computer data interchange format for the [Scala](http://scala-lang.org) programming language.
Example
-------
The following example program shows how to use the convenience functions to write a Scala `Map` object to a UBJSON byte array, and then read that array back to create an equivalent `Map`.
```scala
import xyz.hyperreal.ubjson._
object Main extends App {
val ubjson = writeUBJSON( Map("a" -> "asdf", "b" -> 5) )
println( ubjson.toList map (b => if (b < ' ') b.toString else b.toChar) mkString " " )
println( readUBJSON(ubjson) )
}
```
This program prints
{ i 1 a S i 4 a s d f i 1 b i 5 }
Map(a -> asdf, b -> 5)
which is the contents of the UBJSON byte array, and the resulting `Map` that was read from it.
Usage
-----
Use the following definition to use *ubjson* in your Maven project:
```xml
hyperreal
https://dl.bintray.com/edadma/maven
xyz.hyperreal
ubjson
0.3
```
Add the following to your `build.sbt` file to use *ubjson* in your SBT project:
```sbt
resolvers += "Hyperreal Repository" at "https://dl.bintray.com/edadma/maven"
libraryDependencies += "xyz.hyperreal" %% "ubjson" % "0.3"
```
Building
--------
### Requirements
- Java 11+
- SBT 1.2.8+
- Scala 2.13.0+
### Clone and Run the Tests
```bash
git clone git://github.com/edadma/ubjson.git
cd ubjson
sbt test
```
License
-------
ISC © 2019 Edward A. Maxedon, Sr.