WriterChannel

A JVM AbstractOutputChannel writing every String to writer (or to outputStream, wrapped into one).

Constructors

Link copied to clipboard
constructor(writer: Writer)
constructor(outputStream: OutputStream)

Properties

Link copied to clipboard
override var isClosed: Boolean

Whether this channel has been closed.

Link copied to clipboard
open override val streamTerm: Struct

The Prolog $stream(Direction, Id)-like Struct term identifying this channel, e.g. for current_output/1.

Functions

Link copied to clipboard
open override fun addListener(listener: Listener<String?>)

Registers listener to be invoked with every element subsequently transiting this channel.

Link copied to clipboard
open override fun clearListeners()

Unregisters every currently-registered Listener.

Link copied to clipboard
open override fun close()
Link copied to clipboard
override fun flush()
Link copied to clipboard
open override fun removeListener(listener: Listener<String?>)

Unregisters listener, previously added via addListener.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open fun <R> use(function: OutputChannel<String>.() -> R): R

Runs function against this channel, closeing it once function returns normally (not on exceptions).

Link copied to clipboard
override fun write(value: String)