/** * {@inheritDoc} */ @Override public int read(byte[] b, int off, int len) throws java.io.IOException { int count = source.get(position, b, off, len); position += count; return count; }
/** * {@inheritDoc} * Note that the position will be adjusted to read from the corrected location in the underlying source */ public int get(long position) throws java.io.IOException { if (position >= length) return -1; return source.get(offset + position); }
@Override public int get(long position) throws IOException { synchronized (lockObj) { return source.get(position); } }
/** * {@inheritDoc} */ @Override public int read() throws java.io.IOException { return source.get(position++); } }
/** * {@inheritDoc} */ public int get(long position, byte[] bytes, int off, int len) throws java.io.IOException { return source.get(position, bytes, off, len); }
@Override public int get(long position, byte[] bytes, int off, int len) throws IOException { synchronized (lockObj) { return source.get(position, bytes, off, len); } }
@Override public int get(long position, byte[] bytes, int off, int len) throws IOException { synchronized (lockObj) { return source.get(position, bytes, off, len); } }
/** * {@inheritDoc} */ public int get(long position, byte[] bytes, int off, int len) throws java.io.IOException { return source.get(position, bytes, off, len); }
/** * {@inheritDoc} */ @Override public int read() throws java.io.IOException { return source.get(position++); } }
/** * {@inheritDoc} */ public int get(long position) throws java.io.IOException { return source.get(position); }
/** * {@inheritDoc} * Note that the position will be adjusted to read from the corrected location in the underlying source */ public int get(long position) throws java.io.IOException { if (position >= length) return -1; return source.get(offset + position); }
/** * Reads a single byte * * @return the byte, or -1 if EOF is reached * @throws java.io.IOException in case of any reading error. */ public int read() throws java.io.IOException { if (isBack) { isBack = false; return back & 0xff; } return byteSource.get(byteSourcePosition++); }
/** * {@inheritDoc} */ public int get(long position) throws java.io.IOException { return source.get(position); }
/** * {@inheritDoc} */ public int get(long position, byte[] bytes, int off, int len) throws java.io.IOException { return source.get(position, bytes, off, len); }
/** * Reads a single byte * * @return the byte, or -1 if EOF is reached * @throws java.io.IOException in case of any reading error. */ public int read() throws java.io.IOException { if (isBack) { isBack = false; return back & 0xff; } return byteSource.get(byteSourcePosition++); }
/** * {@inheritDoc} */ public int get(long position, byte[] bytes, int off, int len) throws java.io.IOException { return source.get(position, bytes, off, len); }
/** * {@inheritDoc} * Note that the position will be adjusted to read from the corrected location in the underlying source */ public int get(long position, byte[] bytes, int off, int len) throws java.io.IOException { if (position >= length) return -1; long toRead = Math.min(len, length - position); return source.get(offset + position, bytes, off, (int)toRead); }
/** * {@inheritDoc} * Note that the position will be adjusted to read from the corrected location in the underlying source */ public int get(long position, byte[] bytes, int off, int len) throws java.io.IOException { if (position >= length) return -1; long toRead = Math.min(len, length - position); return source.get(offset + position, bytes, off, (int)toRead); }
/** * {@inheritDoc} * The source that contains the byte at position is retrieved, the correct offset into that source computed, then the value * from that offset in the underlying source is returned. */ public int get(long position) throws java.io.IOException { SourceEntry entry = getSourceEntryForOffset(position); if (entry == null) // we have run out of data to read from return -1; return entry.source.get(entry.offsetN(position)); }
/** * {@inheritDoc} * The source that contains the byte at position is retrieved, the correct offset into that source computed, then the value * from that offset in the underlying source is returned. */ public int get(long position) throws java.io.IOException { SourceEntry entry = getSourceEntryForOffset(position); if (entry == null) // we have run out of data to read from return -1; return entry.source.get(entry.offsetN(position)); }