java.io
public abstract class FilterReader extends Reader
Reader
and simply redirects calls made to it to the subordinate Reader
instead. Subclasses of this class perform additional filtering
functions in addition to simply redirecting the call.
When creating a subclass of FilterReader
, override the
appropriate methods to implement the desired filtering. However, note
that the read(char[])
method does not need to be overridden
as this class redirects calls to that method to
read(yte[], int, int)
instead of to the subordinate
Reader} read(yte[])
method.
Field Summary | |
---|---|
protected Reader | in
This is the subordinate Reader to which method calls
are redirected |
Constructor Summary | |
---|---|
protected | FilterReader(Reader in)
Create a FilterReader with the specified subordinate
Reader .
|
Method Summary | |
---|---|
void | close()
This method closes the stream by calling the close() method
of the underlying stream.
|
void | mark(int readlimit)
Calls the in.mark(int) method.
|
boolean | markSupported()
Calls the in.markSupported() method.
|
int | read()
Calls the in.read() method
|
int | read(char[] buf, int offset, int len)
Calls the in.read(char[], int, int) method.
|
boolean | ready()
Calls the in.read() method.
|
void | reset()
Calls the in.reset() method.
|
long | skip(long num_chars)
Calls the in.skip(long) method
|
Reader
to which method calls
are redirectedFilterReader
with the specified subordinate
Reader
.
The lock
of the new FilterReader
will be set
to in.lock
.
Parameters: in The subordinate Reader
close()
method
of the underlying stream.
Throws: IOException If an error occurs
in.mark(int)
method.
Parameters: readlimit The parameter passed to in.mark(int)
Throws: IOException If an error occurs
in.markSupported()
method.
Returns: true
if mark/reset is supported,
false
otherwise
in.read()
method
Returns: The value returned from in.read()
Throws: IOException If an error occurs
in.read(char[], int, int)
method.
Parameters: buf The buffer to read chars into offset The index into the buffer to start storing chars len The maximum number of chars to read.
Returns: The value retured from in.read(char[], int, int)
Throws: IOException If an error occurs
in.read()
method.
Returns: The value returned from in.available()
Throws: IOException If an error occurs
in.reset()
method.
Throws: IOException If an error occurs
in.skip(long)
method
Parameters: num_chars The requested number of chars to skip.
Returns: The value returned from in.skip(long)
Throws: IOException If an error occurs