- Direct Known Subclasses:
- HashCommentStripperReader, MarkReader, UnixLineReader
- public abstract class LFilterReader
- extends java.io.FilterReader
Details: If you are tempted to use
java.io.FilterReader, try this class instead. An
LFilterReader is essentially a
java.io.FilterReader, except that
final. Since all known
read(char) implementations simply forward to
read(char,int,int) anyway, there is very little reason to override the former when the latter must be overridden as well. (It would be bad design to give the two
reads different behavior.) Therefore, it is sufficient to override
read(char,int,int) in a subclass and continue allowing the superclass's implementation of
read(char) to forward to the other read. Additionally, making
read(char) final helps prevents unexpected polymorphic loops in poorly designed code.
- 1998 (<1998.11.11)
|Fields inherited from class java.io.FilterReader
|Fields inherited from class java.io.Reader
Sets forwarding to Reader.
|Methods inherited from class java.io.FilterReader
close, mark, markSupported, read, read, ready, reset, skip
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public LFilterReader(java.io.Reader reader)
- Sets forwarding to Reader.
Details: This constructor sets the input source to reader. All input requested from this Reader will be taken from reader.
reader - the input source
public final int read(char dest)
- Reads characters.
Details: This implementation of
read forwards to
read (dest, 0, dest . length).
read(char,int,int) for more information.
read in class
dest - the destination array
- number of characters stored
java.io.IOException - if an I/O error occurs