ConsoleInputChannel

A ConsoleInputChannel provides a faux asynchronous interface to a synchronous input stream. The reader must supply UTF-8 encoded characters.

Author

Todd L Smith

Parameters

stream

An input stream. This should generally be System. in.

Constructors

Link copied to clipboard
constructor(stream: InputStream)

Construct a new ConsoleInputChannel that wraps the specified stream.

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun isOpen(): Boolean
Link copied to clipboard
open override fun mark(readAhead: Int)

Mark the current position in the channel. Subsequent calls to reset will attempt to reset this position.

Link copied to clipboard
open override fun <A> read(buffer: CharBuffer, attachment: A?, handler: CompletionHandler<Int, A>)

Reads a sequence of characters from this reader into the given buffer.

Link copied to clipboard
open override fun reset()

Attempt to reposition the channel to the most recently saved mark.