Skip to content

Serialization with bufferable

Sam Ritchie edited this page Aug 21, 2013 · 2 revisions

Bufferable works with Injection. to let you serialize items into a ByteBuffer. (This page is a stub, obviously.)

Here’s the basic idea:

import MyInjections._

// This pulls in Injection[T, Array[Byte]] implicitly;
implicit val myBufferable = Bufferable.of[T]

val myInjection: Injection[(Long, T), Array[Byte]] = Bufferable.injectionOf[(Long, T)]
Clone this wiki locally