Package org.apache.commons.io.input
Class AbstractInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.commons.io.input.AbstractInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
CircularInputStream,MemoryMappedFileInputStream,NullInputStream,RandomAccessFileInputStream,ReaderInputStream
public abstract class AbstractInputStream extends java.io.InputStreamAbstracts some InputStream operations for implementations in this package.- Since:
- 2.17.0
-
-
Constructor Summary
Constructors Constructor Description AbstractInputStream()Constructs a new instance for subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcheckOpen()Checks 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.
-
-
-
Field Detail
-
closed
private boolean closed
Whetherclose()completed successfully.
-
-
Method Detail
-
checkOpen
void checkOpen() throws java.io.IOExceptionChecks if this instance is closed and throws an IOException if so.- Throws:
java.io.IOException- if this instance is closed.
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.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.
-
-