Object - io : WritableByteChannel

WritableByteChannel represents an output resource (i.e file). which could be used to sink bytes.


(byte content, int offset)

returns int | Error

Sink bytes from a given input/output resource.

This operation will be asynchronous, write might return without writing all the content.


  • content byte
  • Block of bytes which should be written

  • offset int
  • Start offset

  • Return Type

    (int | Error)
  • Offset which should be kept when writing bytes. Number of bytes written or Error if any error occurred



returns Error?

Closes a given byte channel.

  • Return Type

  • Will return () if there's no error