Object - io : ReadableDataChannel

Represents a data channel for reading data.

readInt16

()

returns int | IOError

Reads a 16 bit integer.

  • Return Type

    (int | IOError)
  • value of the integer which is read or IOError if any error occurred

readInt32

()

returns int | IOError

Reads a 32 bit integer.

  • Return Type

    (int | IOError)
  • value of the integer which is read or IOError if any error occurred

readInt64

()

returns int | IOError

Reads a 64 bit integer.

  • Return Type

    (int | IOError)
  • value of the integer which is read or IOError if any error occurred

readFloat32

()

returns float | IOError

Reads 32 bit float.

  • Return Type

    (float | IOError)
  • value of the float which is read or IOError if any error occurred

readFloat64

()

returns float | IOError

Reads 64 bit float.

  • Return Type

    (float | IOError)
  • value of the float which is read or IOError if any error occurred

readBool

()

returns boolean | IOError

Reads 1 byte and convert it's value to boolean.

  • Return Type

    (boolean | IOError)
  • boolean value which is read or IOError if any error occurred

readString

(int nBytes, string encoding)

returns string | IOError

Reads string value represented through the provided number of bytes.

Parameters

  • nBytes int
  • specifies the number of bytes which represents the string

  • encoding string
  • specifies the char-set encoding of the string

readVarInt

()

returns int | IOError

Reads a variable length integer.

  • Return Type

    (int | IOError)
  • value of the integer which is read or IOError if any error occurred

close

()

returns IOError?

Closes the data channel.

  • Return Type

    (IOError?)
  • nill if the channel is closed successfully or IOError if any error occurred