|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.Reader
com.gc.iotools.stream.reader.CloseShieldReader<T>
T - Type of the Reader passed in the constructor.public class CloseShieldReader<T extends Reader>
A CloseShieldReader wraps some other Reader,
which it uses as its basic source of data. The class
CloseShieldReader pass all requests to the contained stream,
except the close() method that is not to the underlying
stream.
This class is typically used in cases where a Reader needs to
be passed to a component that wants to explicitly close the stream even if
more input would still be available to other components.
| Field Summary |
|---|
| Fields inherited from class java.io.Reader |
|---|
lock |
| Constructor Summary | |
|---|---|
CloseShieldReader(T source)
Construct a CloseShieldReader that forwards the calls to
the source Reader passed in the constructor. |
|
| Method Summary | |
|---|---|
void |
close()
|
int |
getCloseCount()
Returns the number of time that close was called. |
T |
getWrappedReader()
Returns the wrapped (original) Reader passed in the
constructor. |
void |
mark(int readAheadLimit)
|
boolean |
markSupported()
|
int |
read()
|
int |
read(char[] cbuf)
|
int |
read(char[] cbuf,
int off,
int len)
|
int |
read(CharBuffer target)
|
boolean |
ready()
|
void |
reset()
|
long |
skip(long n)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CloseShieldReader(T source)
CloseShieldReader that forwards the calls to
the source Reader passed in the constructor.
T - a T object.source - original Reader| Method Detail |
|---|
public void close()
throws IOException
Multiple invocation of this method will result in only one invocation
of the close() on the underlying stream.
close in interface Closeableclose in class ReaderIOExceptionpublic int getCloseCount()
public T getWrappedReader()
Returns the wrapped (original) Reader passed in the
constructor.
Reader passed in the constructor
public void mark(int readAheadLimit)
throws IOException
mark in class ReaderIOExceptionpublic boolean markSupported()
markSupported in class Reader
public int read()
throws IOException
read in class ReaderIOException
public int read(char[] cbuf)
throws IOException
read in class ReaderIOException
public int read(char[] cbuf,
int off,
int len)
throws IOException
read in class ReaderIOException
public int read(CharBuffer target)
throws IOException
read in interface Readableread in class ReaderIOException
public boolean ready()
throws IOException
ready in class ReaderIOException
public void reset()
throws IOException
reset in class ReaderIOException
public long skip(long n)
throws IOException
skip in class ReaderIOExceptionpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||