class haxe.io.Input

An Input is an abstract reader. See other classes in the haxe.io package for several possible implementations.

Instance Fields

var bigEndian:Bool

Endianness (word byte order) used when reading numbers.

If true, big-endian is used, otherwise little-endian is used.

function close(): Void

Close the input source.

Behaviour while reading after calling this method is unspecified.

function read(nbytes:Int): Bytes

Read and return nbytes bytes.

function readByte(): Int

Read and return one byte.

function readBytes(s:Bytes, pos:Int, len:Int): Int

Read len bytes and write them into s to the position specified by pos.

Returns the actual length of read data that can be smaller than len.

See readFullBytes that tries to read the exact amount of specified bytes.

function readFullBytes(s:Bytes, pos:Int, len:Int): Void

Read len bytes and write them into s to the position specified by pos.

Unlike readBytes, this method tries to read the exact len amount of bytes.

function readInt32(): Int

Read a 32-bit signed integer.

Endianness is specified by the bigEndian property.

function readLine(): String

Read a line of text separated by CR and/or LF bytes.

The CR/LF characters are not included in the resulting string.

function readString(len:Int): String

Read and len bytes as a string.