Package htsjdk.samtools.seekablestream
Interface ISeekableStreamFactory
-
public interface ISeekableStreamFactory
Factory for creatingSeekableStream
s based on URLs/paths. Implementations can be set as the default withSeekableStreamFactory.setInstance(ISeekableStreamFactory)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description SeekableStream
getBufferedStream(SeekableStream stream)
Return a bufferedSeekableStream
which wraps the inputstream
using the default buffer sizeSeekableStream
getBufferedStream(SeekableStream stream, int bufferSize)
Return a bufferedSeekableStream
which wraps the inputstream
SeekableStream
getStreamFor(String path)
default SeekableStream
getStreamFor(String path, Function<SeekableByteChannel,SeekableByteChannel> wrapper)
Open a stream from the input path, applying the wrapper to the stream.SeekableStream
getStreamFor(URL url)
-
-
-
Method Detail
-
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 bufferedSeekableStream
which wraps the inputstream
using the default buffer size- Parameters:
stream
-- Returns:
-
getBufferedStream
SeekableStream getBufferedStream(SeekableStream stream, int bufferSize)
Return a bufferedSeekableStream
which wraps the inputstream
- 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 openwrapper
- a wrapper to apply to the stream- Returns:
- a stream opened path
- Throws:
IOException
-
-