Package org.apache.sis.storage
Class ProbeInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.sis.storage.ProbeInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
A temporary input stream used for probing purposes.
This stream does not allow mark/reset operations because the mark is reserved for this class.
The
close() method closes this stream but not the wrapped stream, which is only reset.- Since:
- 1.2
- Version:
- 1.2
- See Also:
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in -
Constructor Summary
ConstructorsConstructorDescriptionProbeInputStream(StorageConnector owner, InputStream input) Creates a new input stream which delegates everything to the given input except the mark/reset operations. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this stream and resets the wrapped stream to its original position.voidmark(int readlimit) Does nothing since marks are not supported on this input stream.booleanNotifies the caller that marks are not supported on this input stream.voidreset()Throws an exception since marks are not supported on this input stream.
-
Constructor Details
-
ProbeInputStream
ProbeInputStream(StorageConnector owner, InputStream input) throws IOException, DataStoreException Creates a new input stream which delegates everything to the given input except the mark/reset operations.- Throws:
IOExceptionDataStoreException
-
-
Method Details
-
markSupported
public boolean markSupported()Notifies the caller that marks are not supported on this input stream.- Overrides:
markSupportedin classFilterInputStream
-
mark
public void mark(int readlimit) Does nothing since marks are not supported on this input stream. Note that doing nothing is the behavior of the defaultInputStream.mark(int)implementation. In particular, we cannot declare the checkedIOExceptionhere.- Overrides:
markin classFilterInputStream
-
reset
Throws an exception since marks are not supported on this input stream.- Overrides:
resetin classFilterInputStream- Throws:
IOException
-
close
Closes this stream and resets the wrapped stream to its original position.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterInputStream- Throws:
IOException
-