java.lang.Object | ||
↳ | java.io.Reader | |
↳ | java.io.FilterReader |
Known Direct Subclasses |
Wraps an existing Reader
and performs some transformation on the
input data while it is being read. Transformations can be anything from a
simple byte-wise filtering input data to an on-the-fly compression or
decompression of the underlying reader. Readers that wrap another reader and
provide some additional functionality on top of it usually inherit from this
class.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
in | The target Reader which is being filtered. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.io.Reader
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new FilterReader on the Reader
in .
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Closes this reader.
| |||||||||||
Sets a mark position in this reader.
| |||||||||||
Indicates whether this reader supports
mark() and reset() .
| |||||||||||
Reads a single character from the filtered reader and returns it as an
integer with the two higher-order bytes set to 0.
| |||||||||||
Reads up to
count characters from the filtered reader and stores them
in the byte array buffer starting at offset .
| |||||||||||
Indicates whether this reader is ready to be read without blocking.
| |||||||||||
Resets this reader's position to the last marked location.
| |||||||||||
Skips
charCount characters in this reader.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.io.Reader
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.lang.Readable
| |||||||||||
From interface
java.io.Closeable
| |||||||||||
From interface
java.lang.AutoCloseable
|
Constructs a new FilterReader on the Reader in
.
in | The non-null Reader to filter reads on. |
---|
Closes this reader. This implementation closes the filtered reader.
IOException | if an error occurs while closing this reader. |
---|
Sets a mark position in this reader. The parameter readlimit
indicates how many bytes can be read before the mark is invalidated.
Sending reset()
will reposition this reader back to the marked
position, provided that readlimit
has not been surpassed.
This implementation sets a mark in the filtered reader.
readlimit | the number of bytes that can be read from this reader before the mark is invalidated. |
---|
IOException | if an error occurs while marking this reader. |
---|
Indicates whether this reader supports mark()
and reset()
.
This implementation returns whether the filtered reader supports marking.
true
if mark()
and reset()
are supported
by the filtered reader, false
otherwise.Reads a single character from the filtered reader and returns it as an integer with the two higher-order bytes set to 0. Returns -1 if the end of the filtered reader has been reached.
IOException | if an error occurs while reading from this reader. |
---|
Reads up to count
characters from the filtered reader and stores them
in the byte array buffer
starting at offset
. Returns the
number of characters actually read or -1 if no characters were read and
the end of the filtered reader was encountered.
IOException | if an error occurs while reading from this reader. |
---|
Indicates whether this reader is ready to be read without blocking. If
the result is true
, the next read()
will not block. If
the result is false
, this reader may or may not block when
read()
is sent.
true
if this reader will not block when read()
is called, false
if unknown or blocking will occur.IOException | if the reader is closed or some other I/O error occurs. |
---|
Resets this reader's position to the last marked location. Invocations of
read()
and skip()
will occur from this new location. If
this reader was not marked, the behavior depends on the implementation of
reset()
in the Reader subclass that is filtered by this reader.
The default behavior for Reader is to throw an IOException
.
IOException | if a problem occurred or the filtered reader does not support
mark() and reset() . |
---|
Skips charCount
characters in this reader. Subsequent calls to read
will not return these characters unless reset
is used. The
default implementation is to skip characters in the filtered reader.
IOException | if the filtered reader is closed or some other I/O error occurs. |
---|