Package org.apache.sis.storage
Class ProbeReader
java.lang.Object
java.io.Reader
java.io.FilterReader
org.apache.sis.storage.ProbeReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
A temporary character reader used for probing purposes.
This reader does not allow mark/reset operations because the mark is reserved for this class.
The
close()
method closes this reader but not the wrapped reader, which is only reset.
Note: this wrapper is not used if the reader is an instance of
RewindableLineReader
.
- Since:
- 1.2
- Version:
- 1.2
- See Also:
-
Field Summary
Fields inherited from class java.io.FilterReader
in
-
Constructor Summary
ConstructorsConstructorDescriptionProbeReader
(StorageConnector owner, Reader input) Creates a new reader which delegates everything to the given reader except the mark/reset operations. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this reader and resets the wrapped reader to its original position.void
mark
(int readlimit) Throws an exception since marks are not supported on this reader.boolean
Notifies the caller that marks are not supported on this reader.void
reset()
Throws an exception since marks are not supported on this reader.Methods inherited from class java.io.FilterReader
read, read, ready, skip
Methods inherited from class java.io.Reader
nullReader, read, read, transferTo
-
Constructor Details
-
ProbeReader
ProbeReader(StorageConnector owner, Reader input) throws IOException, DataStoreException Creates a new reader which delegates everything to the given reader except the mark/reset operations.- Throws:
IOException
DataStoreException
-
-
Method Details
-
markSupported
public boolean markSupported()Notifies the caller that marks are not supported on this reader.- Overrides:
markSupported
in classFilterReader
-
mark
Throws an exception since marks are not supported on this reader.- Overrides:
mark
in classFilterReader
- Throws:
IOException
-
reset
Throws an exception since marks are not supported on this reader.- Overrides:
reset
in classFilterReader
- Throws:
IOException
-
close
Closes this reader and resets the wrapped reader to its original position.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterReader
- Throws:
IOException
-