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

All functions which read data throw Eof when the end of the stream is reached.

Methods

close ():Void

Available on Neko, Android, iOS, macOS, Linux, Windows

Close the input source.

Behaviour while reading after calling this method is unspecified.

readAll (?bufsize:Int):Bytes

Available on Neko, macOS, Linux, Windows

Read and return all available data.

The bufsize optional argument specifies the size of chunks by which data is read. Its default value is target-specific.

readByte ():Int

Available on Neko, Android, iOS, macOS, Linux, Windows

Read and return one byte.

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

Available on Neko, macOS, Linux, Windows

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.

readLine ():String

Available on Neko, Android, iOS, macOS, Linux, Windows

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

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