Package com.luciad.io
Interface ILcdInputStreamFactory
- All Known Implementing Classes:
ALcdChunkedInputStreamFactory
,TLcdCompositeInputStreamFactory
,TLcdFailureCachingInputStreamFactory
,TLcdInputStreamFactory
,TLcdStatusInputStreamFactory
,TLcdTarInputStreamFactory
,TLcdZipInputStreamFactory
,TLcyCompositeInputStreamFactory
public interface ILcdInputStreamFactory
An
ILcdInputStreamFactory
creates an InputStream
from a given source.
This can be used in implementations of ILcdModelDecoder
to implement, e.g., ways of securely transferring data from the actual source to the actual decoder.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
canCreateInputStream
(String aSource) Checks whether this input stream factory can provide access toaSource
.createInputStream
(String aSource) Creates anInputStream
fromaSource
.
-
Method Details
-
canCreateInputStream
Checks whether this input stream factory can provide access toaSource
. It is acceptable for this method to returntrue
for a source whilecreateInputStream
throws an exception for that same source.For performance reasons, we strongly recommend that implementations perform only a simple test. For example: check the structure of
aSource
to see if it is a URI with a specific scheme, but do not verify thataSource
really is accessible.The default implementation of this method returns
true
. Make sure to override this method if you can easily reject sources. This can help avoid pointless invocations ofcreateInputStream
which would have to throw exceptions for unsupported sources.- Parameters:
aSource
- the data source to be verified; typically a file name or a URL.- Returns:
true
if this input stream factory can likely access the source,false
otherwise.- Since:
- 2022.0
- See Also:
-
createInputStream
Creates anInputStream
fromaSource
.- Parameters:
aSource
- an accessible data source.- Returns:
- an
InputStream
from the data source. - Throws:
IOException
- whenaSource
is not accepted bycanCreateInputStream
or is not accessible.- See Also:
-