Class Fox::FXStream

In: | FXStream.rb
Parent: | Object

Persistent store definition

## 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

Methods

bytesSwapped= bytesSwapped? close error= littleEndian? new open

Attributes

container | [R] | Parent object [FXObject]
direction | [R] | Stream direction, one of `FXStreamSave`, `FXStreamLoad` or `FXStreamDead`.
position | [RW] | Stream position (an offset from the beginning of the stream) [Integer]
status | [R] | Stream status [Integer]

Public Class methods

new(cont=nil) {|theStream| ...}

Constructor

littleEndian?()

Returns `true` if little-endian architecture

Public Instance methods

open(save_or_load)

Open stream and return `true` if OK. The save_or_load parameter is one of `FXStreamSave` or `FXStreamLoad`.

close()

Close stream; returns `true` if OK.

error=(err)

Set status code, where err is one of the stream status codes listed above.

bytesSwapped=(swapBytes)

Set the byte-swapped flag to `true` or `false`.

bytesSwapped?()

Returns `true` if bytes are swapped for this stream