Added in API level 1

FilterReader

abstract class FilterReader : Reader
kotlin.Any
   ↳ java.io.Reader
   ↳ java.io.FilterReader

Abstract class for reading filtered character streams. The abstract class FilterReader itself provides default methods that pass all requests to the contained stream. Subclasses of FilterReader should override some of these methods and may also provide additional methods and fields.

Summary

Protected constructors

Creates a new filtered reader.

Public methods
open Unit

open Unit
mark(readAheadLimit: Int)

Marks the present position in the stream.

open Boolean

Tells whether this stream supports the mark() operation.

open Int

Reads a single character.

open Int
read(cbuf: CharArray!, off: Int, len: Int)

Reads characters into a portion of an array.

open Boolean

Tells whether this stream is ready to be read.

open Unit

Resets the stream.

open Long
skip(n: Long)

Skips characters.

Inherited functions
Properties
Reader!

The underlying character-input stream.

Inherited properties

Protected constructors

FilterReader

Added in API level 1
protected FilterReader(in: Reader!)

Creates a new filtered reader.

Parameters
in Reader!: a Reader object providing the underlying stream.
Exceptions
java.lang.NullPointerException if in is null

Public methods

close

Added in API level 1
open fun close(): Unit
Exceptions
java.lang.Exception if this resource cannot be closed
java.io.IOException if an I/O error occurs

mark

Added in API level 1
open fun mark(readAheadLimit: Int): Unit

Marks the present position in the stream.

Parameters
readAheadLimit Int: Limit on the number of characters that may be read while still preserving the mark. After reading this many characters, attempting to reset the stream may fail.
Exceptions
java.io.IOException If an I/O error occurs

markSupported

Added in API level 1
open fun markSupported(): Boolean

Tells whether this stream supports the mark() operation.

Return
Boolean true if and only if this stream supports the mark operation.

read

Added in API level 1
open fun read(): Int

Reads a single character.

Return
Int The character read, as an integer in the range 0 to 65535 (0x00-0xffff), or -1 if the end of the stream has been reached
Exceptions
java.io.IOException If an I/O error occurs

read

Added in API level 1
open fun read(
    cbuf: CharArray!,
    off: Int,
    len: Int
): Int

Reads characters into a portion of an array.

Parameters
cbuf CharArray!: Destination buffer
off Int: Offset at which to start storing characters
len Int: Maximum number of characters to read
Return
Int The number of characters read, or -1 if the end of the stream has been reached
Exceptions
java.io.IOException If an I/O error occurs
java.lang.IndexOutOfBoundsException If off is negative, or len is negative, or len is greater than cbuf.length - off

ready

Added in API level 1
open fun ready(): Boolean

Tells whether this stream is ready to be read.

Return
Boolean True if the next read() is guaranteed not to block for input, false otherwise. Note that returning false does not guarantee that the next read will block.
Exceptions
java.io.IOException If an I/O error occurs

reset

Added in API level 1
open fun reset(): Unit

Resets the stream.

Exceptions
java.io.IOException If an I/O error occurs

skip

Added in API level 1
open fun skip(n: Long): Long

Skips characters.

Parameters
n Long: The number of characters to skip
Return
Long The number of characters actually skipped
Exceptions
java.io.IOException If an I/O error occurs

Properties

in

Added in API level 1
protected var in: Reader!

The underlying character-input stream.