java.io

Class FilterReader

Implemented Interfaces:
Closeable, Readable
Known Direct Subclasses:
ProxyReader, PushbackReader

public abstract class FilterReader
extends Reader

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.
Since:
JDK1.1

Field Summary

protected Reader
in
The underlying character-input stream.

Fields inherited from class java.io.Reader

lock

Constructor Summary

FilterReader(Reader in)
Create a new filtered reader.

Method Summary

void
close()
Close the stream.
void
mark(int readAheadLimit)
Mark the present position in the stream.
boolean
markSupported()
Tell whether this stream supports the mark() operation.
int
read()
Read a single character.
int
read(cbuf[] , int off, int len)
Read characters into a portion of an array.
boolean
ready()
Tell whether this stream is ready to be read.
void
reset()
Reset the stream.
long
skip(long n)
Skip characters.

Methods inherited from class java.io.Reader

close, mark, markSupported, read, read, read, read, ready, reset, skip

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

in

protected Reader in
The underlying character-input stream.

Constructor Details

FilterReader

protected FilterReader(Reader in)
Create a new filtered reader.
Parameters:
in - a Reader object providing the underlying stream.
Throws:
NullPointerException - if in is null

Method Details

close

public void close()
            throws IOException
Close the stream.
Specified by:
close in interface Closeable
Overrides:
close in interface Reader
Throws:
IOException - If an I/O error occurs

mark

public void mark(int readAheadLimit)
            throws IOException
Mark the present position in the stream.
Overrides:
mark in interface Reader
Throws:
IOException - If an I/O error occurs

markSupported

public boolean markSupported()
Tell whether this stream supports the mark() operation.
Overrides:
markSupported in interface Reader

read

public int read()
            throws IOException
Read a single character.
Overrides:
read in interface Reader
Throws:
IOException - If an I/O error occurs

read

public int read(cbuf[] ,
                int off,
                int len)
            throws IOException
Read characters into a portion of an array.
Overrides:
read in interface Reader
Throws:
IOException - If an I/O error occurs

ready

public boolean ready()
            throws IOException
Tell whether this stream is ready to be read.
Overrides:
ready in interface Reader
Throws:
IOException - If an I/O error occurs

reset

public void reset()
            throws IOException
Reset the stream.
Overrides:
reset in interface Reader
Throws:
IOException - If an I/O error occurs

skip

public long skip(long n)
            throws IOException
Skip characters.
Overrides:
skip in interface Reader
Throws:
IOException - If an I/O error occurs