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 TypeMethodDescriptionvoid
close()
Closes this stream and resets the wrapped stream to its original position.void
mark
(int readlimit) Does nothing since marks are not supported on this input stream.boolean
Notifies the caller that marks are not supported on this input stream.void
reset()
Throws an exception since marks are not supported on this input stream.Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
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:
IOException
DataStoreException
-
-
Method Details
-
markSupported
public boolean markSupported()Notifies the caller that marks are not supported on this input stream.- Overrides:
markSupported
in 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 checkedIOException
here.- Overrides:
mark
in classFilterInputStream
-
reset
Throws an exception since marks are not supported on this input stream.- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-
close
Closes this stream and resets the wrapped stream to its original position.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterInputStream
- Throws:
IOException
-