read

open override fun read(): Int

Reads a single character from the stream:contentReferenceoaicite:5{index=5}. Returns the character as an integer (0-65535) or -1 if the end of the stream has been reached:contentReferenceoaicite:6{index=6}.

Throws

IOException

if an I/O error occurs.


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

Reads up to len characters into the specified portion of the character array cbuf:contentReferenceoaicite:7{index=7}. It returns the number of characters read, or -1 if the end of the stream has been reached before any characters are read:contentReferenceoaicite:8{index=8}. This method will block until at least one character is available or end-of-stream is detected.

Return

the number of characters read, or -1 if no characters were read because the stream is at EOF.

Parameters

cbuf

the destination buffer.

off

the start offset in cbuf at which to store characters.

len

the maximum number of characters to read.

Throws

if the parameters are invalid.

IOException

if an I/O error occurs.