/** * @param fn File name of the data file (used for error messages only) * @param idxFn Full path to the index file. Auto-generated if null * @param stream Seekable stream from which the data is read */ public TabixReader(final String fn, final String idxFn, SeekableStream stream) throws IOException { mFn = fn; mFp = new BlockCompressedInputStream(stream); if(idxFn == null){ mIdxFn = ParsingUtils.appendToPath(fn, TabixUtils.STANDARD_INDEX_EXTENSION); } else { mIdxFn = idxFn; } readIndex(); }
/** * @param filePath Path to the data file (used for error messages only) * @param indexPath Full path to the index file. Auto-generated if null * @param indexWrapper a wrapper to apply to the raw byte stream of the index file if it is a uri representing a {@link java.nio.file.Path} * @param stream Seekable stream from which the data is read */ public TabixReader(final String filePath, final String indexPath, SeekableStream stream, Function<SeekableByteChannel, SeekableByteChannel> indexWrapper) throws IOException { mFilePath = filePath; mFp = new BlockCompressedInputStream(stream); mIndexWrapper = indexWrapper; if(indexPath == null){ mIndexPath = ParsingUtils.appendToPath(filePath, TabixUtils.STANDARD_INDEX_EXTENSION); } else { mIndexPath = indexPath; } readIndex(); }
/** * @param filePath Path to the data file (used for error messages only) * @param indexPath Full path to the index file. Auto-generated if null * @param indexWrapper a wrapper to apply to the raw byte stream of the index file if it is a uri representing a {@link java.nio.file.Path} * @param stream Seekable stream from which the data is read */ public TabixReader(final String filePath, final String indexPath, SeekableStream stream, Function<SeekableByteChannel, SeekableByteChannel> indexWrapper) throws IOException { mFilePath = filePath; mFp = new BlockCompressedInputStream(stream); mIndexWrapper = indexWrapper; if(indexPath == null){ mIndexPath = ParsingUtils.appendToPath(filePath, TabixUtils.STANDARD_INDEX_EXTENSION); } else { mIndexPath = indexPath; } readIndex(); }
/** * Read the Tabix index from the default file. */ private void readIndex() throws IOException { final ISeekableStreamFactory ssf = SeekableStreamFactory.getInstance(); readIndex(ssf.getBufferedStream(ssf.getStreamFor(mIndexPath, mIndexWrapper), 128000)); }
/** * Read the Tabix index from the default file. */ private void readIndex() throws IOException { final ISeekableStreamFactory ssf = SeekableStreamFactory.getInstance(); readIndex(ssf.getBufferedStream(ssf.getStreamFor(mIndexPath, mIndexWrapper), 128000)); }
/** * Read the Tabix index from the default file. */ private void readIndex() throws IOException { ISeekableStreamFactory ssf = SeekableStreamFactory.getInstance(); readIndex(ssf.getBufferedStream(ssf.getStreamFor(mIdxFn), 128000)); }