iobuf.writer

function

Library: Buffers (OMIOBUF)
Import : omiobuf.xmd

Returns: A writable output target for streaming data.


Declaration
export external string sink function 
   writer of value buffer output-buffer


Purpose

Use iobuf.writer to write data to the iobuf.buffer passed to it.

Example

The following program uses an instance of iobuf.buffer to hold data and subsequently output it.

  import "omiobuf.xmd" prefixed by iobuf.
  
  process
     local iobuf.buffer b
  
     using output as iobuf.writer of b
        output "Hello, World!%n"
  
     output iobuf.reader of b

Usage Note

To use this funciton, you must import OMIOBUF into your program using an import declaration such as:

  import "omiobuf.xmd" prefixed by io.

Other Library Functions