KBufferedReader

class KBufferedReader(reader: KReader, bufferSize: Int, context: KnioContext) : KReader

A buffered reader that reads characters from a KReader.

Parameters

reader

The KReader to read characters from.

bufferSize

The size of the buffer to use.

Constructors

Link copied to clipboard
constructor(reader: KReader, bufferSize: Int, context: KnioContext)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend fun KReader.buffered(bufferSize: Int? = null): KBufferedReader
Link copied to clipboard
open suspend override fun close()

Closes the stream and releases any system resources associated with it.

Link copied to clipboard
open suspend override fun mark(readLimit: Int)

Marks the present position in the stream. Subsequent calls to reset() will attempt to reposition the stream to this point.

Link copied to clipboard
open suspend override fun markSupported(): Boolean

Tells whether this stream supports the mark() operation, which it does.

Link copied to clipboard
open suspend override fun read(): Int

Reads a single character.

open suspend override fun read(b: CharBuffer): Int

Reads characters into a CharBuffer.

open suspend override fun read(cbuf: CharArray, off: Int, len: Int): Int

Reads characters into a portion of an array.

open suspend fun read(b: CharArray): Int

Reads characters into an array.

Link copied to clipboard
suspend fun readLine(): String?

Reads a line of text. A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a linefeed.

Link copied to clipboard
suspend fun KReader.readText(): String
Link copied to clipboard
open suspend override fun ready(): Boolean

Tells whether this stream is ready to be read. A buffered character stream is ready if the buffer is not empty, or if the underlying character stream is ready.

Link copied to clipboard
open suspend override fun reset()

Resets the stream to the most recent mark.

Link copied to clipboard
open suspend override fun skip(n: Long): Long

Skips characters.