@Override public void close() { try { super.close(); } catch (IOException e) { throw new RuntimeIOException(e); } } }
public void encode(final String str) { try { dos.writeUTF(str); } catch (IOException e) { throw new RuntimeIOException(e); } }
@Override public long skip(final long n) { try { return delegate.skip(n); } catch (final IOException e) { throw new RuntimeIOException(e); } }
@Override public void write(@SuppressWarnings("NullableProblems") final byte[] b) { try { out.write(b); } catch (final IOException e) { throw new RuntimeIOException(e); } }
@Override public void reset() { try { delegate.reset(); } catch (final IOException e) { throw new RuntimeIOException(e); } count = 0; }
@Override public void write(final byte[] value) { try { outputStream.write(value); outputStream.write(stop); } catch (IOException e) { throw new RuntimeIOException(e); } } }
private void println(final String s) { try { writer.append(s); writer.append("\n"); } catch (IOException e) { throw new RuntimeIOException(e); } }
@Override public void skipBytes(final int count) { try { for (int s = count; s > 0;) { final int skipped = (int)in.skip(s); if (skipped <= 0) throw new RuntimeIOException("Failed to skip " + s); s -= skipped; } } catch (final IOException e) { throw new RuntimeIOException(e); } }
@Override public boolean isDone(final PositionalBufferedStream source) { try { return source.isDone(); } catch (final IOException e) { throw new RuntimeIOException("Failure reading from stream.", e); } }
@Override public Integer read() { try { return helper.read(coreBlockInputStream); } catch (IOException e) { throw new RuntimeIOException(e); } }
@Override public void write(final Integer value) { try { helper.write(coreBlockOutputStream, value); } catch (IOException e) { throw new RuntimeIOException(e); } }
@Override public void readBytes(final byte[] bytes) { try { in.read(bytes); } catch (final IOException e) { throw new RuntimeIOException(e); } }
@Override public SeekableStream get() { try { return new SeekablePathStream(pathResource, wrapper); } catch (final IOException e) { throw new RuntimeIOException(e); } } });
@Override public void close() { flush(); try { out.close(); } catch (final IOException e) { throw new RuntimeIOException(e); } }
public static CramSpanContainerIterator fromFileSpan(final SeekableStream seekableStream, final long[] coordinates) { try { return new CramSpanContainerIterator(seekableStream, coordinates); } catch (final IOException e) { throw new RuntimeIOException(e); } }
@Override public void close() { try { in.close(); } catch (final IOException e) { throw new RuntimeIOException(e); } }
public StreamInflatingIndexingOutputStream(final OutputStream s1, final Path indexPath) { try { this.s1 = s1; this.s2 = new PipedOutputStream(); final PipedInputStream pin = new PipedInputStream(this.s2, Defaults.NON_ZERO_BUFFER_SIZE); this.thread = new Thread(new Indexer(indexPath, pin), "BamIndexingThread"); this.thread.start(); } catch (final IOException ioe) { throw new RuntimeIOException(ioe); } }
/** * Public method for sub-classes or ultimately consumers to put an item into the queue * to be written out. */ public void write(final T item) { if (this.isClosed.get()) throw new RuntimeIOException("Attempt to add record to closed writer."); checkAndRethrow(); try { this.queue.put(item); } catch (final InterruptedException ie) { throw new RuntimeException("Interrupted queueing item for writing.", ie); } checkAndRethrow(); }
@Override public void close() { if (mCompressedStream == null) { throw new SAMException("Null input stream."); } try { mCompressedStream.close(); } catch (IOException ioe) { throw(new RuntimeIOException("Close error in CSI compressed stream: " + ioe)); } }
static IndexFileBuffer getBuffer(File file, boolean enableMemoryMapping) { boolean isCompressed; try { isCompressed = IOUtil.isBlockCompressed(file.toPath()); } catch (IOException ioe) { throw (new RuntimeIOException(ioe)); } return isCompressed ? new CompressedIndexFileBuffer(file) : (enableMemoryMapping ? new MemoryMappedFileBuffer(file) : new RandomAccessFileBuffer(file)); } }