Serializer

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.

The serializer is also provided a function for recognizing objects that do not need to be scanned because they're explicitly provided. These objects are numbered with negative indices. The inverse of this function needs to be provided to the Deserializer, so that negative indices can be converted to objects.

Author

Mark van Gulik

Constructors

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

Construct a Serializer which converts a series of objects into bytes.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun serialize(obj: A_BasicObject)

Serialize this AvailObject so that it will appear as the next checkpoint object during deserialization.

Link copied to clipboard
fun serializedObjectsTuple(): AvailObject

The tuple of objects that were serialized by this serializer. This is only valid after serialization completes.

Properties

Link copied to clipboard
val module: A_Module? = null

The optional A_Module within which serialization is occurring. If present, it is used to detect capture of atoms that are not defined in ancestor modules.

Link copied to clipboard
val output: OutputStream

An OutputStream on which to write the serialized objects.