A dynamic pickler for type T
.
Exception thrown when a stream ends unexpectedly during unpickling.
A builder of pickled content.
A builder of pickled content. This is a mutable API, intended to be called in certain specific ways.
Here are a few static rules that all picklers must follow when using this interface.
1. You will be given a type hint before any beginEntry() call. 2. There will be one endEntry() for every beginEntry() call. 3. There will be one endCollection() for every beginCollection() call. 4. Every beginCollection()/endCollection() pair will be inside a beginEntry()/endEntry() pair. 5. Every putElement() call must happen within a beginCollection()/endCollection() block. 6. Every putField() call must happen within a beginEntry()/endEntry() block. 7. There is no guarantee that putElement() will be called within a beginCollectoin()/endCollection() pair. i.e. we can write empty collections. 8. There is no guarantee that putField will be called within a beginEntry()/endEntry() pair. i.e. if we don't put any fields, this means the entry was for a "primitive" type, at least what The pickling library considers primitives. 9. The order of putField calls in any pickler will be the exact same ordering when unpickling, if the format is compatible.
Here is a list of all types the auto-generated Picklers considers "primitives" and must be directly supported by any PBuilder:
A reader of pickled content.
A reader of pickled content. This is a mutable API, intended to be called in certain specific ways.
Here are a few static rules that all picklers must follow when using this interface.
1. There must be a hintTag() before any beginEntry() call. 2. There will be one endEntry() for every beginEntry() call. 3. There will be one endCollection() for every beginCollection() call. 4. Every beginCollection()/endCollection() pair will be inside a beginEntry()/endEntry() pair. 5. Every readLength() call will be immediately after a beginCollection() call. 6. Every readElement() call must happen within a beginCollection()/endCollection() block, and after a readLength(). 7. Every readField() call must happen within a beginEntry()/endEntry() block. 8. If readLength() returns 0, there will be no called to readElement(). 9. readField() will only be called where atObject would return true 10. readPrimitive will only be called when atPrimitive would return true 11. The order of readField calls in any pickler will be the exact same ordering when pickling,
Here is a list of all types the auto-generated Picklers considers "primitives" and must be directly supported by any PReader "readPrimitive" operation:
Appends the pickle/pickleTo/pickleInto operations onto any type, assuming implicits picklers are available.
Exception thrown when the pickling or unpickling process fails.
Exception thrown when the pickling or unpickling process fails.
error message
exception causing the pickling exception if any
A static pickler for type T
.
A static pickler for type T
. Its pickle
method takes an object-to-be-pickled of
static type T
, and pickles it to an instance of PBuilder
. In the process the object
is turned into some external representation like a byte array. The particular external
representation (the "pickle format") is defined by the builder
.
This pickler requires that the dynamic type of the object-to-be-pickled is equal to
the erasure of its static type T
.
This is something which knowns how to reconstitute/materialize a type out of a pickle reader.
This is something which knowns how to reconstitute/materialize a type out of a pickle reader.
Import scala.pickling.Defaults._
to introduce all picklers and ops.
A dynamic pickler for type
T
. Itspickle
method takes an object-to-be-pickled of static typeT
, and pickles it to an instance ofPBuilder
. In the process the object is turned into some external representation like a byte array. The particular external representation (the "pickle format") is defined by thebuilder
.In contrast to static picklers (instances of type
SPickler[T]
), a dynamic pickler of typeDPickler[T]
pickles any object of typeT
.