Class AdapterInputSource

java.lang.Object
com.espertech.esperio.csv.AdapterInputSource

public class AdapterInputSource extends Object
An input source for adapters.
  • Constructor Details

    • AdapterInputSource

      public AdapterInputSource(String classpathResource)
      Ctor.
      Parameters:
      classpathResource - - the name of the resource on the classpath to use as the source for an adapter
    • AdapterInputSource

      public AdapterInputSource(URL url)
      Ctor.
      Parameters:
      url - - the URL for the resource to use as source for an adapter
    • AdapterInputSource

      public AdapterInputSource(File file)
      Ctor.
      Parameters:
      file - - the file to use as a source
    • AdapterInputSource

      public AdapterInputSource(InputStream inputStream)
      Ctor.
      Parameters:
      inputStream - - the stream to use as a source
    • AdapterInputSource

      public AdapterInputSource(Reader reader)
      Ctor.
      Parameters:
      reader - is any reader for reading a file or string
  • Method Details

    • getAsStream

      public InputStream getAsStream()
      Get the resource as an input stream. If this resource was specified as an InputStream, return that InputStream, otherwise, create and return a new InputStream from the resource. If the source cannot be converted to a stream, return null.
      Returns:
      a stream from the resource
    • getAsReader

      public Reader getAsReader()
      Return the reader if it was set, null otherwise.
      Returns:
      the Reader
    • isResettable

      public boolean isResettable()
      Return true if calling getStream() will return a new InputStream created from the resource, which, assuming that the resource hasn't been changed, will have the same information as all the previous InputStreams returned by getStream() before they were manipulated; return false if the call will return the same instance of InputStream that has already been obtained.
      Returns:
      true if each call to getStream() will create a new InputStream from the resource, false if each call will get the same instance of the InputStream
    • close

      public void close()