Object - io : WritableByteChannel

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

write

(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.

Parameters

  • 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

close

()

returns Error?

Closes a given byte channel.

  • Return Type

    (Error?)
  • Will return () if there's no error