Giter VIP home page Giter VIP logo

boopickle's Introduction

BooPickle

Join the chat at https://gitter.im/ochrons/boopickle

Build Status Scala.js

BooPickle is the fastest and most size efficient serialization (aka pickling) library that works on both Scala and Scala.js. It encodes into a binary format instead of the more customary JSON. A binary format brings efficiency gains in both size and speed, at the cost of legibility of the encoded data. BooPickle borrows heavily from both uPickle and Prickle so special thanks to Li Haoyi and Ben Hutchison for those two great libraries!

Features

  • Supports both Scala and Scala.js (no reflection!)
  • Serialization support for all primitives, collections, options, tuples and case classes (including class hierarchies)
  • User-definable custom serializers
  • Transforming serializers to simplify serializing non-case classes
  • Handles references and deduplication of identical objects
  • Very fast
  • Very efficient coding
  • Low memory usage, no intermediate structures needed
  • Zero dependencies
  • Scala 2.11/2.12
  • All modern browsers are supported (not IE9 and below, though)

Getting started

Add following dependency declaration to your Scala project

"io.suzaku" %% "boopickle" % "1.3.0"

On a Scala.js project the dependency looks like this

"io.suzaku" %%% "boopickle" % "1.3.0"

To use it in your code, simply import the Default object contents. All examples in this document assume this import is present.

import boopickle.Default._

To serialize (pickle) something, just call Pickle.intoBytes with your data. This will produce a binary ByteBuffer containing an encoded version of your data.

val data = Seq("Hello", "World!")
val buf = Pickle.intoBytes(data)

And to deserialize (unpickle) the buffer, call Unpickle.fromBytes, specifying the type of your data. BooPickle doesn't encode any type information, so you must use the same types when pickling and unpickling.

val helloWorld = Unpickle[Seq[String]].fromBytes(buf)

Documentation

Read the full documentation

Change history

See a separate changes document

Contributors

BooPickle was created and is maintained by Otto Chrons - [email protected] - Twitter: @ochrons.

Special thanks to Li Haoyi and Ben Hutchison for their pickling libraries, which provided more than inspiration to BooPickle.

Contributors: @japgolly, @FlorianKirmaier, @guersam, @akshaal, @cquiroz, @cornerman, @notxcain

boopickle's People

Contributors

akshaal avatar benhutchison avatar cornerman avatar cquiroz avatar fdietze avatar floriankirmaier avatar fomkin avatar gitter-badger avatar guersam avatar japgolly avatar lihaoyi avatar notxcain avatar ochrons avatar olivierblanvillain avatar slandelle avatar

Watchers

 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.