java.io
Class FilterReader
java.lang.Object
|
+--java.io.Reader
|
+--java.io.FilterReader
public abstract class
FilterReaderextends
Reader This is the common superclass of all standard classes that filter
input. It acts as a layer on top of an underlying
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.
Authors:- Aaron M. Renn (arenn@urbanophile.com)
- Warren Levy <warrenl@cygnus.com>
in
protected Reader in
This is the subordinate Reader
to which method calls
are redirected
FilterReader
protected FilterReader(java.io.Reader in)
Create a FilterReader
with the specified subordinate
Reader
.
The lock
of the new FilterReader
will be set
to in.lock
.
Parameters:
close
public void close()
This method closes the stream by calling the close()
method
of the underlying stream.
Throws:
mark
public void mark(int readlimit)
Calls the in.mark(int)
method.
Parameters:
Throws:
markSupported
public boolean markSupported()
Calls the in.markSupported()
method.
Returns:
true
if mark/reset is supported, false
otherwise
read
public int read()
Calls the in.read()
method
Returns:
- The value returned from
in.read()
Throws:
read
public int read(char[] buf, int offset, int len)
Calls the in.read(char[], int, int)
method.
Parameters:
Returns:
- The value retured from
in.read(char[], int, int)
Throws:
ready
public boolean ready()
Calls the in.read()
method.
Returns:
- The value returned from
in.available()
Throws:
reset
public void reset()
Calls the in.reset()
method.
Throws:
skip
public long skip(long num_chars)
Calls the in.skip(long)
method
Parameters:
Returns:
- The value returned from
in.skip(long)
Throws:
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 theread(char[])
method does not need to be overridden as this class redirects calls to that method toread(yte[], int, int)
instead of to the subordinateReader} read(yte[])
method.