Interface ISeekableStreamFactory


public interface ISeekableStreamFactory
Factory for creating SeekableStreams based on URLs/paths. Implementations can be set as the default with SeekableStreamFactory.setInstance(ISeekableStreamFactory)
  • Method Details

    • getStreamFor

      SeekableStream getStreamFor(URL url) throws IOException
      Throws:
      IOException
    • getStreamFor

      SeekableStream getStreamFor(String path) throws IOException
      Throws:
      IOException
    • getBufferedStream

      SeekableStream getBufferedStream(SeekableStream stream)
      Return a buffered SeekableStream which wraps the input stream using the default buffer size
      Parameters:
      stream -
      Returns:
    • getBufferedStream

      SeekableStream getBufferedStream(SeekableStream stream, int bufferSize)
      Return a buffered SeekableStream which wraps the input stream
      Parameters:
      stream -
      bufferSize -
      Returns:
    • getStreamFor

      default SeekableStream getStreamFor(String path, Function<SeekableByteChannel,SeekableByteChannel> wrapper) throws IOException
      Open a stream from the input path, applying the wrapper to the stream. The wrapper allows applying operations directly to the byte stream so that things like caching, prefetching, or decryption can be done at the raw byte level. The default implementation throws if wrapper != null, but implementations may support this wrapping operation
      Parameters:
      path - a uri like String representing a resource to open
      wrapper - a wrapper to apply to the stream
      Returns:
      a stream opened path
      Throws:
      IOException