File and console I/O primitives. FileReader and FileWriter handle sequential file access; Console provides stdin/stdout operations. Included in lang.obl — no extra -lib flag needed.
Deserializer
Used to deserialize objects
Operations
- New
- Holds
- IsOk
- ReadBool
- ReadBoolArray
- ReadByteArray
- ReadChar
- ReadCharArray
- ReadFloat
- ReadFloatArray
- ReadInt
- ReadIntArray
- ReadObject
- ReadObjectArray
- Remaining
Holds #
Whether count values of 8 bytes or more could still be read: the bound to apply to a count read from the stream before allocating an array of that size, so a file that claims a billion values does not get them.
method : public : Holds(count:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| count | Int | number of values |
Return
| Type | Description |
|---|---|
| Bool | true if count is not negative and the bytes left could hold that many |
Holds #
Whether rows x cols values of 8 bytes or more could still be read, without multiplying them (the product of two counts from a file can overflow).
method : public : Holds(rows:Int, cols:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| rows | Int | number of rows |
| cols | Int | number of columns |
Return
| Type | Description |
|---|---|
| Bool | true if both are positive and the bytes left could hold that many |
IsOk #
Checks that the stream has been readable so far: false if the input was Nil, damaged, truncated or not zlib data, and false from the first read that found the stream too short, an array that declares more than the stream holds, or a value of another type than the read asked for. Check it after the last read, as the reads themselves answer their zero value.
method : public : IsOk() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | false once any read has failed |
New # constructor
Default constructor. Input that is Nil or not a whole zlib stream, as a damaged or foreign file is, does not end the program: IsOk() is false and every read answers its zero value (0, 0.0, false, Nil).
New(buffer:Byte[])Parameters
| Name | Type | Description |
|---|---|---|
| buffer | Byte | input byte buffer to read from |
ReadBoolArray #
Reads an array of values
method : public : ReadBoolArray() ~ Bool[]Return
| Type | Description |
|---|---|
| Bool | array of values |
ReadByteArray #
Reads an array of values
method : public : ReadByteArray() ~ Byte[]Return
| Type | Description |
|---|---|
| Byte | array of values |
ReadCharArray #
Reads an array of values
method : public : ReadCharArray() ~ Char[]Return
| Type | Description |
|---|---|
| Char | array of values |
ReadFloatArray #
Reads an array of values
method : public : ReadFloatArray() ~ Float[]Return
| Type | Description |
|---|---|
| Float | array of values |
ReadIntArray #
Reads an array of values
method : public : ReadIntArray() ~ Int[]Return
| Type | Description |
|---|---|
| Int | array of values |