public class CloseShieldReader extends ProxyReader
This class is typically used in cases where a reader needs to be passed to a component that wants to explicitly close the reader even if more input would still be available to other components.
in| Modifier and Type | Method and Description |
|---|---|
void |
close()
Replaces the underlying reader with a
ClosedReader sentinel. |
static CloseShieldReader |
wrap(Reader reader)
Constructs a proxy that shields the given reader from being closed.
|
afterRead, beforeRead, handleIOException, mark, markSupported, read, read, read, read, ready, reset, skippublic void close()
ClosedReader sentinel. The
original reader will remain open, but this proxy will appear closed.close in interface Closeableclose in interface AutoCloseableclose in class ProxyReaderpublic static CloseShieldReader wrap(Reader reader)
reader - the reader to wrap