Input

package haxe.io

extended by NativeInput, BufferInput, BytesInput, NativeInput, NativeInput, FileInput

Available on all platforms

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.

Variables

bigEndian:Bool

Endianness (word byte order) used when reading numbers.

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

Methods

close():Void

Close the input source.

Behaviour while reading after calling this method is unspecified.

read(nbytes:Int):Bytes

Read and return nbytes bytes.

readAll(?bufsize:Int):Bytes

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

Read and return one byte.

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.

readDouble():Float

Read a 64-bit double-precision floating point number.

Endianness is specified by the bigEndian property.

readFloat():Float

Read a 32-bit floating point number.

Endianness is specified by the bigEndian property.

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.

readInt16():Int

Read a 16-bit signed integer.

Endianness is specified by the bigEndian property.

readInt24():Int

Read a 24-bit signed integer.

Endianness is specified by the bigEndian property.

readInt32():Int

Read a 32-bit signed integer.

Endianness is specified by the bigEndian property.

readInt8():Int

Read a 8-bit signed integer.

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.

readString(len:Int, ?encoding:Encoding):String

Read and len bytes as a string.

readUInt16():Int

Read a 16-bit unsigned integer.

Endianness is specified by the bigEndian property.

readUInt24():Int

Read a 24-bit unsigned integer.

Endianness is specified by the bigEndian property.

readUntil(end:Int):String

Read a string until a character code specified by end is occurred.

The final character is not included in the resulting string.

© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/haxe/io/Input.html