GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - andresilva/bytes: Fast, typesafe and boilerplate-free object serialization in Scala

BranchesTags
Open more actions menu

Latest commit

 

History

18 Commits
18 Commits

Folders and files

NameName
Last commit message
Last commit date
benchmark
benchmark
 
 
core/src/main/scala/io/github/andrebeat/bytes
core/src/main/scala/io/github/andrebeat/bytes
 
 
project
project
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
sbt
sbt
 
 

Repository files navigation

bytes

A playground for fast, typesafe and boilerplate-free object serialization in Scala.

This is what we've got so far:

import io.github.andrebeat.bytes._

case class Foo(
  b: Byte,
  s: Short,
  c: Char,
  i: Int,
  f: Float,
  l: Long,
  d: Double,
  is: List[Int],
  set: Set[Char],
  map: Map[Long, Int],
  opt: Option[Float],
  either: Either[Byte, Int])

val foo = Foo(
    1, 42, '?', 13231, 9023.0f, 55554434L, 321.0,
    1 :: 2 :: 3 :: Nil,
    Set('a', 'b', 'c'),
    Map(99L -> 0, 98L -> 1),
    None,
    Right(4))

val bytes: Bytes = UnsafeBytes(1024)

Write(bytes, 0, foo)
// res0: Int = 83

val (foo2, size) = Read[Foo](bytes, 0)
// foo2: Foo = Foo(1,42,?,13231,9023.0,55554434,321.0,List(1, 2, 3),Set(a, b, c),Map(99 -> 0, 98 -> 1),None,Right(4))
// size: Int = 83

About

Fast, typesafe and boilerplate-free object serialization in Scala

Resources

Readme
MIT license
Activity

Stars

3 stars

Watchers

0 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.