@Override public int read(byte[] b, int off, int len) throws IOException { if (len == 0) return 0; int copied = 0; while (0 < len) { int c = Math.min(block.count - blockPos, len); if (0 < c) { System.arraycopy(block.buffer, blockPos, b, off, c); blockPos += c; off += c; len -= c; copied += c; } else if (nextBlock()) continue; else break; } return 0 < copied ? copied : -1; }
@Override public long skip(long cnt) throws IOException { long skipped = 0; while (0 < cnt) { int n = (int) Math.min(block.count - blockPos, cnt); if (0 < n) { blockPos += n; skipped += n; cnt -= n; } else if (nextBlock()) continue; else break; } return skipped; }
@Override public int read(byte[] b, int off, int len) throws IOException { if (len == 0) return 0; int copied = 0; while (0 < len) { int c = Math.min(block.count - blockPos, len); if (0 < c) { System.arraycopy(block.buffer, blockPos, b, off, c); blockPos += c; off += c; len -= c; copied += c; } else if (nextBlock()) continue; else break; } return 0 < copied ? copied : -1; }
@Override public int read(byte[] b, int off, int len) throws IOException { if (len == 0) return 0; int copied = 0; while (0 < len) { int c = Math.min(block.count - blockPos, len); if (0 < c) { System.arraycopy(block.buffer, blockPos, b, off, c); blockPos += c; off += c; len -= c; copied += c; } else if (nextBlock()) continue; else break; } return 0 < copied ? copied : -1; }
@Override public long skip(long cnt) throws IOException { long skipped = 0; while (0 < cnt) { int n = (int) Math.min(block.count - blockPos, cnt); if (0 < n) { blockPos += n; skipped += n; cnt -= n; } else if (nextBlock()) continue; else break; } return skipped; }
@Override public long skip(long cnt) throws IOException { long skipped = 0; while (0 < cnt) { int n = (int) Math.min(block.count - blockPos, cnt); if (0 < n) { blockPos += n; skipped += n; cnt -= n; } else if (nextBlock()) continue; else break; } return skipped; }