? CloseShieldReader
java.lang.Object
java.io.Reader
java.io.FilterReader
org.apache.commons.io.input.ProxyReader
org.apache.commons.io.input.CloseShieldReader
- ????????:
Closeable
,AutoCloseable
,Readable
Proxy reader that prevents the underlying reader from being closed.
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.
- ???????:
- 2.7
-
????
??????? java.io.FilterReader
in
-
?????
????????CloseShieldReader
(Reader reader) ????Using this constructor prevents IDEs from warning if the underlying reader is never closed. -
????
??????????void
close()
Replaces the underlying reader with aClosedReader
sentinel.static CloseShieldReader
Creates a proxy that shields the given reader from being closed.??????? org.apache.commons.io.input.ProxyReader
afterRead, beforeRead, handleIOException, mark, markSupported, read, read, read, read, ready, reset, skip
??????? java.io.Reader
nullReader, transferTo
-
???????
-
CloseShieldReader
????Using this constructor prevents IDEs from warning if the underlying reader is never closed. Usewrap(Reader)
instead.Creates a proxy that shields the given reader from being closed.- ??:
reader
- underlying reader
-
-
??????
-
wrap
Creates a proxy that shields the given reader from being closed.- ??:
reader
- the reader to wrap- ??:
- the created proxy
- ???????:
- 2.9.0
-
close
Replaces the underlying reader with aClosedReader
sentinel. The original reader will remain open, but this proxy will appear closed.- ???:
close
????AutoCloseable
- ???:
close
????Closeable
- ??:
close
???ProxyReader
-