KStringReader

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. Once the stream has been closed, further read(), ready(), mark(), or reset() invocations will throw an IOException. Closing a previously closed stream has no effect. This method will block while there is another thread blocking on the reader.

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

Marks the present position in the stream. Subsequent calls to reset() will 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 fun read(): Int

Reads a single character.

open suspend fun read(b: CharArray): Int

Reads characters into an array.

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

Reads characters into a portion of an array.

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

Attempts to read characters into the specified character buffer. The buffer is used as a repository of characters as-is: the only changes made are the results of a put operation. No flipping or rewinding of the buffer is performed.

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.

Link copied to clipboard
open suspend override fun reset()

Resets the stream to the most recent mark, or to the beginning of the string if it has never been marked.

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

Skips the specified number of characters in the stream. Returns the number of characters that were skipped.