Package htsjdk.samtools.seekablestream

# Interface ISeekableStreamFactory

public interface ISeekableStreamFactory
Factory for creating `SeekableStream`s based on URLs/paths. Implementations can be set as the default with `SeekableStreamFactory.setInstance(ISeekableStreamFactory)`

## Method Summary

Modifier and Type
Method
Description
`SeekableStream`
`getBufferedStream(SeekableStream stream)`
Return a buffered `SeekableStream` which wraps the input `stream` using the default buffer size
`SeekableStream`
`getBufferedStream(SeekableStream stream, int bufferSize)`
Return a buffered `SeekableStream` which wraps the input `stream`
`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 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`