@Override public long skip(long byteCount) throws IOException { long skipped = super.skip(byteCount); if (skipped > 0) { // See https://errorprone.info/bugpattern/NarrowingCompoundAssignment. position = (int) (position + skipped); } return skipped; }
@Override public long skip(long n) throws IOException { long rc = super.skip(n); if (rc > 0) { position += rc; } return rc; } public long getPosition() {
@Override public long skip(long n) throws IOException { n = super.skip(n); if (n > 0) { pos += n; } return n; }
/** * flush n bytes, and reset bitbuf, bitsLeft * often used to align the byte array * NOTE: n may be negative integer, e.g. -2 */ public void skip(int n) throws IOException { bitbuf = 0; bitsLeft = 0; super.skip(n); }
@Override public long skip(long n) throws IOException { n = super.skip(n); if (n > 0) { pos += n; } return n; }
@Override public long skip(long n) throws IOException { long rc = super.skip(n); if (rc > 0) { position += rc; } return rc; } public long getPosition() {
@Override public long skip(final long n) throws IOException { final long result = super.skip(Math.min(n, limit)); if (result >= 0) { limit -= result; } return result; } }
@Override public long skip(final long n) throws IOException { final long result = super.skip(Math.min(n, limit)); if (result >= 0) { limit -= result; } return result; } }
@Override public long skip(long byteCount) throws IOException { final long result; if (returnZeroFlag) { result = 0; } else { result = super.skip(byteCount); } returnZeroFlag = !returnZeroFlag; return result; } }
@Override public long skip(final long n) throws IOException { final long result = super.skip(Math.min(n, limit)); if (result >= 0) { limit -= result; } return result; } }
@Override public long skip(long byteCount) throws IOException { long toActuallySkip = byteCount / 2; if (byteCount == 1) { toActuallySkip = 1; } return super.skip(toActuallySkip); } }
@Override public long skip(long n) throws IOException { long v = super.skip(Math.min(remaining, n)); remaining -= v; return v; } }
@Override public long skip(long n) throws IOException { long v = super.skip(Math.min(remaining, n)); remaining -= v; return v; } }
@Override public long skip(long n) throws IOException { return super.skip(Math.min(max, n)); } }
@Override public long skip(final long n) throws IOException { long skipped = super.skip(n); if (skipped < 1) { final int b = super.read(); if (b >= 0) { skipped = 1; } } if (skipped < 0 && consumedCount < minLength) { throw new EOFException(); } if (skipped >= 0) { consumedCount += skipped; } return skipped; }
@Override public long skip(final long n) throws IOException { try { final long count = super.skip(n); bytesConsumed += count; return count; } catch (final IOException ioe) { throw new FlowFileAccessException("Could not skip data in " + flowFile, ioe); } }
@Override public long skip(long byteCount) throws IOException { long toSkip = getBytesToRead(byteCount); if (toSkip == END_OF_STREAM) { return 0; } long read = super.skip(toSkip); updateAvailableBytesAfterRead(read); return read; }
@Override public long skip(long n) throws IOException { long cnt = super.skip(n); if (cnt > 0) { checkThreshold(); } return cnt; }
/** * Skips bytes from the input stream until it finds the <project> * element. * * @throws IOException thrown if an I/O error occurs */ private void skipToProject() throws IOException { final byte[] buffer = new byte[BUFFER_SIZE]; super.mark(BUFFER_SIZE); int count = super.read(buffer, 0, BUFFER_SIZE); while (count > 0) { final int pos = findSequence(PROJECT, buffer); if (pos >= 0) { super.reset(); super.skip(pos); return; } else if (count - PROJECT.length == 0) { return; } super.reset(); super.skip(count - PROJECT.length); super.mark(BUFFER_SIZE); count = super.read(buffer, 0, BUFFER_SIZE); } }
/** {@inheritDoc} */ @Override public long skip(long cnt) throws IOException { try { beginRead(); return super.skip(cnt); } catch (InterruptedIOException e) { throw readTimedOut(); } finally { endRead(); } }