Object - io : ReadableDataChannel

Represents a data channel for reading data.

readInt16

()

returns int | Error

Reads a 16 bit integer.

  • Return Type

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

readInt32

()

returns int | Error

Reads a 32 bit integer.

  • Return Type

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

readInt64

()

returns int | Error

Reads a 64 bit integer.

  • Return Type

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

readFloat32

()

returns float | Error

Reads 32 bit float.

  • Return Type

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

readFloat64

()

returns float | Error

Reads 64 bit float.

  • Return Type

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

readBool

()

returns boolean | Error

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

  • Return Type

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

readString

(int nBytes, string encoding)

returns string | Error

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

  • Return Type

    (string | Error)
  • value of the string or an error

readVarInt

()

returns int | Error

Reads a variable length integer.

  • Return Type

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

close

()

returns Error?

Closes the data channel.

  • Return Type

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