reader

Reads data from a binary or text stream. Use the given methods to parse data types or iterate over the reader
object directly for utf-8 characters in a text stream:

foreach(c in reader) {
print(c)
}

Methods

boolean() reads a 1-byte boolean value from a binary stream
buffer(integer size) reads bytes from a stream into a new buffer object
float() reads a floating point value from a binary stream
integer(integer size) reads an integer value from a binary stream
lines() returns an iterator over lines of text
string() read a string value from a binary stream
tell() returns the location in the stream if available

Method Documentation


bool boolean()

Reads a 1-byte boolean value from a binary stream

Returns


buffer buffer(integer size)

Reads bytes from a stream into a new buffer object

Parameters

Returns


float float()

Reads a floating point value from a binary stream

Returns


integer integer(integer size)

Reads an integer value from a binary stream

Parameters

Returns


iterator lines()

Returns an iterator over lines of text

Returns


string string()

Read a string value from a binary stream. The stream is read until a terminating '/0' character or the end of the stream is encountered.

Do not use this method to read from a text stream, use the lines() iterator or iterate utf-8 characters over the reader object itself

Returns


integer tell()

Returns the location in the stream if available

Returns



Creative Commons Logo This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.