@Override public LocationAware makeIndexableSourceFromStream(final InputStream bufferedInputStream) { final PositionalBufferedStream pbs; if (bufferedInputStream instanceof PositionalBufferedStream) { pbs = (PositionalBufferedStream) bufferedInputStream; } else { pbs = new PositionalBufferedStream(bufferedInputStream); } return new AsciiLineReaderIterator(new AsciiLineReader(pbs)); }
/** Returns the byte position at the beginning of the next line. */ @Override public long getPosition() { final Tuple<String, Long> peek = peek(); // Be careful: peek will be null at the end of the stream. return peek != null ? peek.b : asciiLineReader.getPosition(); } }
@Override public LineIterator makeSourceFromStream(final InputStream bufferedInputStream) { return new LineIteratorImpl(new SynchronousLineReader(bufferedInputStream)); }
@Override public PositionalBufferedStream makeSourceFromStream(final InputStream bufferedInputStream) { if (bufferedInputStream instanceof PositionalBufferedStream) return (PositionalBufferedStream) bufferedInputStream; else return new PositionalBufferedStream(bufferedInputStream); }
@Override public Object readActualHeader(final LineIterator lineIterator) { this.headerLine = lineIterator.next(); return headerLine; }
@Override public LocationAware makeIndexableSourceFromStream(final InputStream inputStream) { return new AsciiLineReaderIterator(AsciiLineReader.from(inputStream)); }
@Override public LineIterator makeSourceFromStream(final InputStream bufferedInputStream) { return new LineIteratorImpl(LineReaderUtil.fromBufferedStream(bufferedInputStream)); }
@Override public void close() { if ( is != null ) is.close(); lineBuffer = null; }
@Override public final int read() throws IOException { final int c = peek(); if ( c >= 0 ) { // update position and buffer offset if peek says we aren't yet done position++; nextChar++; } return c; }
@Override public String toString() { return "TabixReader: filename:"+getSource(); } }
/** * Returns the byte position at the end of the most-recently-read line (a.k.a., the beginning of the next line) from {@link #next()} in * the underlying {@link AsciiLineReader}. */ @Override public long getPosition() { return i.getPosition(); }
/** * Like {@link #fromBufferedStream(java.io.InputStream, LineReaderUtil.LineReaderOption)}, but the synchronicity * option is determined by {@link htsjdk.samtools.Defaults}: if asynchronous I/O is enabled, an asynchronous line reader will be * returned. */ public static LineReader fromBufferedStream(final InputStream stream) { return fromBufferedStream(stream, Defaults.USE_ASYNC_IO ? LineReaderOption.ASYNCHRONOUS : LineReaderOption.SYNCHRONOUS); }
@Override public LocationAware makeIndexableSourceFromStream(final InputStream bufferedInputStream) { final PositionalBufferedStream pbs; if (bufferedInputStream instanceof PositionalBufferedStream) { pbs = (PositionalBufferedStream) bufferedInputStream; } else { pbs = new PositionalBufferedStream(bufferedInputStream); } return new AsciiLineReaderIterator(new AsciiLineReader(pbs)); }
@Override public LineIterator makeSourceFromStream(final InputStream bufferedInputStream) { return new LineIteratorImpl(new SynchronousLineReader(bufferedInputStream)); }
@Override public LocationAware makeIndexableSourceFromStream(final InputStream inputStream) { return new AsciiLineReaderIterator(AsciiLineReader.from(inputStream)); }
/** Returns the byte position at the beginning of the next line. */ @Override public long getPosition() { final Tuple<String, Long> peek = peek(); // Be careful: peek will be null at the end of the stream. return peek != null ? peek.b : asciiLineReader.getPosition(); } }
@Override public final int read() throws IOException { final int c = peek(); if ( c >= 0 ) { // update position and buffer offset if peek says we aren't yet done position++; nextChar++; } return c; }
/** * Returns the byte position at the end of the most-recently-read line (a.k.a., the beginning of the next line) from {@link #next()} in * the underlying {@link AsciiLineReader}. */ @Override public long getPosition() { return i.getPosition(); }
/** Returns the byte position at the beginning of the next line. */ @Override public long getPosition() { final Tuple<String, Long> peek = peek(); // Be careful: peek will be null at the end of the stream. return peek != null ? peek.b : asciiLineReader.getPosition(); } }