class Fox::FXStream

A stream is a way to serialize data and objects into a byte stream. Each item of data that is saved or loaded from the stream may be byte-swapped, thus allowing little-endian machines to read data produced on big endian ones and vice-versa. Data is serialized exactly as-is. There are no tags or other markers inserted into the stream; thus, the stream may be used to save or load arbitrary binary data. Objects derived from FXObjects may be serialized also; whenever a reference to an object is serialized, a table is consulted to determine if the same object has been encountered previously; if not, the object is added to the table and then its contents are serialized. If the object has been encountered before, only a reference to the object is serialized. When loading back a serialized object, new instances are constructed using the default constructor, and subsequently the object’s contents are loaded. A special container object may be passed in which is placed in the table as if it had been encountered before; this will cause only references to this object to be saved. The container object is typically the top-level document object which manages all objects contained by it. Additional objects may be added using addObject(); these will not be actually saved or loaded.

Stream status codes

FXStreamOK

OK

FXStreamEnd

Try read past end of stream

FXStreamFull

Filled up stream buffer or disk full

FXStreamNoWrite

Unable to open for write

FXStreamNoRead

Unable to open for read

FXStreamFormat

Stream format error

FXStreamUnknown

Trying to read unknown class

FXStreamAlloc

Alloc failed

FXStreamFailure

General failure

Stream data flow direction

FXStreamDead

Unopened stream

FXStreamSave

Saving stuff to stream

FXStreamLoad

Loading stuff from stream

Stream seeking

FXFromStart

Seek from start position

FXFromCurrent

Seek from current position

FXFromEnd

Seek from end position