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 Type
    Method
    Description
    default boolean
    Checks whether this input stream factory can provide access to aSource.
    Creates an InputStream from aSource.
  • Method Details

    • canCreateInputStream

      default boolean canCreateInputStream(String aSource)
      Checks whether this input stream factory can provide access to aSource. It is acceptable for this method to return true for a source while createInputStream 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 that aSource 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 of createInputStream 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

      InputStream createInputStream(String aSource) throws IOException
      Creates an InputStream from aSource.
      Parameters:
      aSource - an accessible data source.
      Returns:
      an InputStream from the data source.
      Throws:
      IOException - when aSource is not accepted by canCreateInputStream or is not accessible.
      See Also: