Package org.apache.commons.io.input
Class AbstractInputStream
java.lang.Object
java.io.InputStream
org.apache.commons.io.input.AbstractInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
CircularInputStream,MemoryMappedFileInputStream,NullInputStream,RandomAccessFileInputStream,ReaderInputStream
Abstracts some InputStream operations for implementations in this package.
- Since:
- 2.17.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidChecks if this instance is closed and throws an IOException if so.voidclose()booleanisClosed()Tests whether this instance is closed; ifclose()completed successfully.voidsetClosed(boolean closed) Sets whether this instance is closed.Methods inherited from class java.io.InputStream
available, mark, markSupported, read, read, read, reset, skip
-
Field Details
-
closed
private boolean closedWhetherclose()completed successfully.
-
-
Constructor Details
-
AbstractInputStream
public AbstractInputStream()
-
-
Method Details
-
checkOpen
Checks if this instance is closed and throws an IOException if so.- Throws:
IOException- if this instance is closed.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
isClosed
public boolean isClosed()Tests whether this instance is closed; ifclose()completed successfully.- Returns:
- whether this instance is closed.
-
setClosed
public void setClosed(boolean closed) Sets whether this instance is closed.- Parameters:
closed- whether this instance is closed.
-