Giter VIP home page Giter VIP logo

ubjson's Introduction

ubjson

Build Status Build status Coverage Status License Version

ubjson is an implementation of the Universal Binary JSON (UBJSON) computer data interchange format for the Scala 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.

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:

<repository>
  <id>hyperreal</id>
  <url>https://dl.bintray.com/edadma/maven</url>
</repository>

<dependency>
  <groupId>xyz.hyperreal</groupId>
  <artifactId>ubjson</artifactId>
  <version>0.3</version>
</dependency>

Add the following to your build.sbt file to use ubjson in your SBT project:

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

git clone git://github.com/edadma/ubjson.git
cd ubjson
sbt test

License

ISC © 2019 Edward A. Maxedon, Sr.

ubjson's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.