AbstractDeserializer

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.

Author

Mark van Gulik

Parameters

input

An InputStream from which to reconstruct objects.

runtime

The AvailRuntime from which to locate well-known objects during deserialization.

lookupPumpedObject

A function that maps from negative integers to objects that this deserializer has been primed with. This is the inverse function of Serializer.lookupPumpedObject.

Constructors

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

Construct a new Deserializer.

Functions

Link copied to clipboard
fun readByte(): Int

Consume an unsigned byte from the input. Return it as an Int to ensure it's unsigned, i.e., 0 ≤ b ≤ 255.

Link copied to clipboard
fun readInt(): Int

Consume an int from the input in big endian order.

Link copied to clipboard
fun readShort(): Int

Consume an unsigned short from the input in big endian order. Return it as an Int to ensure it's unsigned, i.e., 0 ≤ b ≤ 65535.

Properties

Link copied to clipboard
var currentModule: A_Module

The current module.

Link copied to clipboard
val loadedModules: A_Map

The A_Modules that were already loaded in the runtime during instance creation.

Inheritors

Link copied to clipboard
Link copied to clipboard