|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Reader
java.io.FilterReader
public abstract class FilterReader
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.
Field Summary | |
---|---|
protected Reader |
in
This is the subordinate Reader to which method calls
are redirected |
Fields inherited from class java.io.Reader |
---|
lock |
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 |
Methods inherited from class java.io.Reader |
---|
read, read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Reader in
Reader
to which method calls
are redirected
Constructor Detail |
---|
protected FilterReader(Reader in)
FilterReader
with the specified subordinate
Reader
.
The lock
of the new FilterReader
will be set
to in.lock
.
in
- The subordinate Reader
Method Detail |
---|
public void mark(int readlimit) throws IOException
in.mark(int)
method.
mark
in class Reader
readlimit
- The parameter passed to in.mark(int)
IOException
- If an error occurspublic boolean markSupported()
in.markSupported()
method.
markSupported
in class Reader
true
if mark/reset is supported,
false
otherwisepublic void reset() throws IOException
in.reset()
method.
reset
in class Reader
IOException
- If an error occurspublic boolean ready() throws IOException
in.read()
method.
ready
in class Reader
in.available()
IOException
- If an error occurspublic long skip(long num_chars) throws IOException
in.skip(long)
method
skip
in class Reader
num_chars
- The requested number of chars to skip.
in.skip(long)
IOException
- If an error occurspublic int read() throws IOException
in.read()
method
read
in class Reader
in.read()
IOException
- If an error occurspublic int read(char[] buf, int offset, int len) throws IOException
in.read(char[], int, int)
method.
read
in class Reader
buf
- The buffer to read chars intooffset
- The index into the buffer to start storing charslen
- The maximum number of chars to read.
in.read(char[], int, int)
IOException
- If an error occurspublic void close() throws IOException
close()
method
of the underlying stream.
close
in interface Closeable
close
in class Reader
IOException
- If an error occurs
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |