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 booleancanCreateInputStream(String aSource) Checks whether this input stream factory can provide access toaSource.createInputStream(String aSource) Creates anInputStreamfromaSource.
-
Method Details
-
canCreateInputStream
Checks whether this input stream factory can provide access toaSource. It is acceptable for this method to returntruefor a source whilecreateInputStreamthrows 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
aSourceto see if it is a URI with a specific scheme, but do not verify thataSourcereally 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 ofcreateInputStreamwhich would have to throw exceptions for unsupported sources.- Parameters:
aSource- the data source to be verified; typically a file name or a URL.- Returns:
trueif this input stream factory can likely access the source,falseotherwise.- Since:
- 2022.0
- See Also:
-
createInputStream
Creates anInputStreamfromaSource.- Parameters:
aSource- an accessible data source.- Returns:
- an
InputStreamfrom the data source. - Throws:
IOException- whenaSourceis not accepted bycanCreateInputStreamor is not accessible.- See Also:
-