StringReader

Constructors

Link copied to clipboard
constructor(s: String)

Functions

Link copied to clipboard
open 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
fun mark(readAheadLimit: Int)

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

Link copied to clipboard

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

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

Reads characters into a CharBuffer. This default implementation reads into an array and then puts the characters into the buffer.

open override fun read(): Int

Reads a single character.

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

Reads characters into a portion of an array.

Link copied to clipboard
open override fun ready(): Boolean

Tells whether this stream is ready to be read.

Link copied to clipboard
open 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
fun skip(n: Long): Long

Skips characters. If the stream is already at its end before this method is invoked, then no characters are skipped and zero is returned.

Link copied to clipboard
open fun transferTo(out: Writer): Long

Reads all characters from this Reader and writes them to out. Returns the number of characters transferred.