Package avail. serialization
Types
An AbstractDeserializer consumes a stream of bytes to reconstruct objects that had been previously serialized with a Serializer.
A Deserializer takes a stream of bytes and reconstructs objects that had been previously serialized with a Serializer.
A DeserializerDescriber takes a stream of bytes and outputs a description of what would be reconstructed by a Deserializer.
In the same way that a modern CPU manages a small number of prefetch streams, we keep object references short (ideally one byte) by managing a small array of Ints that point to recently accessed referenced objects. During serialization, an algorithm decides whether to reuse an existing pointer, adjusting it by a small offset, or jump to a new absolute position because there were no pointers close enough to produce an efficient relative adjustment. During deserialization, the pointers are used to reconstruct each offset or new absolute position, and the appropriate pointer is updated in exactly same way as occurred during serialization.
This interface defines the abstract protocol for compressing a sequence of integers used by the Serializer and Deserializer.
A Serializer converts a series of objects passed individually to serialize into a stream of bytes which, when replayed in a Deserializer, will reconstruct an analogous series of objects.
A SerializerOpcode describes how to disassemble and assemble the various kinds of objects encountered in Avail.