Package avail.serialization

Types

Link copied to clipboard
abstract class AbstractDeserializer(    input: InputStream,     runtime: AvailRuntime,     lookupPumpedObject: (Int) -> A_BasicObject)

An AbstractDeserializer consumes a stream of bytes to reconstruct objects that had been previously serialized with a Serializer.

Link copied to clipboard
class Deserializer(    input: InputStream,     runtime: AvailRuntime,     lookupPumpedObject: (Int) -> A_BasicObject = { throw Exception("Deserializer has no pumped objects.") }) : AbstractDeserializer

A Deserializer takes a stream of bytes and reconstructs objects that had been previously serialized with a Serializer.

Link copied to clipboard
class DeserializerDescriber(input: InputStream, runtime: AvailRuntime) : AbstractDeserializer

A DeserializerDescriber takes a stream of bytes and outputs a description of what would be reconstructed by a Deserializer.

Link copied to clipboard
class FourStreamIndexCompressor : IndexCompressor

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.

Link copied to clipboard
interface IndexCompressor

This interface defines the abstract protocol for compressing a sequence of integers used by the Serializer and Deserializer.

Link copied to clipboard
class Serializer(    val output: OutputStream,     val module: A_Module? = null,     lookupPumpedObject: (A_BasicObject) -> Int = { 0 })

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.

Link copied to clipboard
enum SerializerOperation : Enum<SerializerOperation>

A SerializerOpcode describes how to disassemble and assemble the various kinds of objects encountered in Avail.