Skip reading the specified number of bytes. Use this method only if you know skipping data is safe.
For simply skipping the next value, use {@link #skipValue()}.

@param numBytes
@throws IOException
978129
private void skipPayload(int numBytes)
            throws IOException
    {
        while (true) {
            int bufferRemaining = buffer.size() - position;
            if (bufferRemaining >= numBytes) {
                position += numBytes;
                return;
            }
            else {
                position += bufferRemaining;
                numBytes -= bufferRemaining;
            }
            nextBuffer();
        }
    }
469076
public static void skip(DataInputStream in) throws IOException {
        byte[] preamble = new byte[PREAMBLE.length];
        in.readFully(preamble);
        if (!Arrays.equals(preamble,PREAMBLE))
            return;    // not a valid preamble

        DataInputStream decoded = new DataInputStream(new UnbufferedBase64InputStream(in));
        int macSz = - decoded.readInt();
        if (macSz > 0) { // new format
            IOUtils.skip(decoded, macSz);
            int sz = decoded.readInt();
            IOUtils.skip(decoded, sz);
        } else { // old format
            int sz = -macSz;
            IOUtils.skip(decoded, sz);
        }

        byte[] postamble = new byte[POSTAMBLE.length];
        in.readFully(postamble);
    }
257198
@Override
    public ByteBuffer readBytes(int numBytes) throws IOException {
        final int appsz = applicationBufferSize();
        ByteBuf readbuf = m_ce.allocator().ioBuffer(packetBufferSize());
        CompositeByteBuf msgbb = Unpooled.compositeBuffer();

        try {
            ByteBuf clear = doUnwrap(readbuf, appsz);

            msgbb.addComponent(true, clear);
            int needed = numBytes;
            if (numBytes == NOT_AVAILABLE) {
                needed = msgbb.readableBytes() >= 4 ? validateLength(msgbb.readInt()) : NOT_AVAILABLE;
            }
            while (msgbb.readableBytes() < (needed == NOT_AVAILABLE ? 4 : needed)) {
                clear = doUnwrap(readbuf, appsz);

                msgbb.addComponent(true, clear);

                if (needed == NOT_AVAILABLE && msgbb.readableBytes() >= 4) {
                    needed = validateLength(msgbb.readInt());
                }
            }

            ByteBuffer retbb = ByteBuffer.allocate(needed);
            msgbb.readBytes(retbb);
            msgbb.discardReadComponents();

            assert !msgbb.isReadable() : "read from unblocked channel that received multiple messages?";

            return (ByteBuffer)retbb.flip();
        } finally {
            readbuf.release();
            msgbb.release();
        }
    }
807853
@Override
	public StringValue readRecord(StringValue reuse, byte[] bytes, int offset, int numBytes) {
		if (this.ascii) {
			reuse.setValueAscii(bytes, offset, numBytes);
			return reuse;
		}
		else {
			ByteBuffer byteWrapper = this.byteWrapper;
			if (bytes != byteWrapper.array()) {
				byteWrapper = ByteBuffer.wrap(bytes, 0, bytes.length);
				this.byteWrapper = byteWrapper;
			}
			byteWrapper.limit(offset + numBytes);
			byteWrapper.position(offset);

			try {
				CharBuffer result = this.decoder.decode(byteWrapper);
				reuse.setValue(result);
				return reuse;
			}
			catch (CharacterCodingException e) {
				if (skipInvalidLines) {
					return null;
				} else {
					byte[] copy = new byte[numBytes];
					System.arraycopy(bytes, offset, copy, 0, numBytes);
					throw new RuntimeException("Line could not be encoded: " + Arrays.toString(copy), e);
				}
			}
		}
	}
426470
private static void skipStream(InputStream in, long count) throws IOException {
        long size = count;
        long skipped = 0;
        while (size > 0 && skipped >= 0) {
            skipped = in.skip(size);
            if (skipped != -1) {
                size -= skipped;
            }
        }
    }
870165
private void skip() {
        try {
            int blockSize;
            do {
                blockSize = read();
                rawData.position(rawData.position() + blockSize);
            } while (blockSize > 0);
        } catch (IllegalArgumentException ex) {
        }
    }
895165
@Override
  public long skip (final long nBytesToSkip) throws IOException
  {
    _getBufIfOpen (); // Check for closed stream
    if (nBytesToSkip <= 0)
      return 0;

    long nAvail = (long) m_nCount - m_nPos;
    if (nAvail <= 0)
    {
      // If no mark position set then don't keep in buffer
      if (m_nMarkPos < 0)
        return _getInIfOpen ().skip (nBytesToSkip);

      // Fill in buffer to save bytes for reset
      _fill ();
      nAvail = (long) m_nCount - m_nPos;
      if (nAvail <= 0)
        return 0;
    }

    final long nSkipped = nAvail < nBytesToSkip ? nAvail : nBytesToSkip;
    m_nPos += nSkipped;
    return nSkipped;
  }
403484
private byte[] readBytes(final int numBytes, String messageType) throws IOException {
    final String errMsg = isNullOrEmpty(messageType)
                          ? "Error reading from ssh-agent."
                          : "Error reading " + messageType + " from ssh-agent.";

    final byte[] result = new byte[numBytes];

    final int bytesRead;
    try {
      bytesRead = in.read(result, 0, numBytes);
    } catch (IOException e) {
      log.error(errMsg);
      throw Throwables.propagate(e);
    }

    if (bytesRead == -1) {
      log.error(errMsg);
      throw new IOException(errMsg);
    }

    return result;
  }
110875
public static final void skip(SeekableByteChannel ch, long skip) throws IOException
    {
        ch.position(ch.position() + skip);
    }
288811
public int skip(int maxSize) {
		int s = maxSize;
		while (hasRemaining()) {
			ByteBuf buf = bufs[first];
			int remaining = buf.readRemaining();
			if (s < remaining) {
				buf.moveHead(s);
				return maxSize;
			} else {
				buf.recycle();
				first = next(first);
				s -= remaining;
			}
		}
		return maxSize - s;
	}
63267
@SuppressWarnings("unchecked")
    public VirtualConnection read(long numBytes, WsByteBuffer[] requestBuffers) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "read entry: stream " + myID + " request: " + requestBuffers + " num bytes requested: " + numBytes);
        }

        long streamByteCount = streamReadSize; // number of bytes available on this stream
        long requestByteCount = bytesRemaining(requestBuffers); // total capacity of the caller byte array
        int reqArrayIndex = 0; // keep track of where we are in the caller's array

        // if at least numBytes are ready to be processed as part of the HTTP Request/Response, then load it up
        if (numBytes > streamReadSize || requestBuffers == null) {
            if (this.headersCompleted) {
                return h2HttpInboundLinkWrap.getVirtualConnection();
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "read exit: stream " + myID + " more bytes requested than available for read: " + numBytes + " > " + streamReadSize);
                }
                return null;
            }
        }

        if (streamByteCount < requestByteCount) {
            // the byte count requested exceeds the caller array capacity
            actualReadCount = streamByteCount;
        } else {
            actualReadCount = requestByteCount;
        }

        // copy bytes from this stream into the caller arrays
        for (int bytesRead = 0; bytesRead < actualReadCount; bytesRead++) {

            // find the first buffer from the caller that has remaining capacity
            while ((requestBuffers[reqArrayIndex].position() == requestBuffers[reqArrayIndex].limit())) {
                reqArrayIndex++;
            }

            // find the next stream buffer that has data
            while (!streamReadReady.isEmpty() && !streamReadReady.get(0).hasRemaining()) {
                streamReadReady.get(0).release();
                streamReadReady.remove(0);
            }
            requestBuffers[reqArrayIndex].put(streamReadReady.get(0).get());
        }

        // put stream array back in shape
        streamReadSize = 0;
        readLatch = new CountDownLatch(1);
        for (WsByteBuffer buffer : ((ArrayList<WsByteBuffer>) streamReadReady.clone())) {
            streamReadReady.clear();
            if (buffer.hasRemaining()) {
                moveDataIntoReadBufferArray(buffer.slice());
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "read exit: " + streamId());
        }
        // return the vc since this was a successful read
        return h2HttpInboundLinkWrap.getVirtualConnection();
    }
315192
@Override
	public long skip(long n) throws IOException {
		long result = stream.skip(n);
		update(result);
		return result;
	}
962127
protected final int readBytes()
        throws IOException
    {
        mBytePtr = 0;
        mByteBufferEnd = 0;
        if (mIn != null) {
            int count = mIn.read(mByteBuffer, 0, mByteBuffer.length);
            if (count > 0) {
                mByteBufferEnd = count;
            }
            return count;
        }
        return -1;
    }
97400
public synchronized void skipTo(final long newValue) throws IllegalStateException {
    if (newValue < currentValue) {
      throw new IllegalStateException(
          "Cannot skip to less than the current value (="
          + currentValue + "), where newValue=" + newValue);
    }
    currentValue = newValue;
  }
1358737
public static void skip(InputStream stream, long skip) throws IOException
   {
      long count = skip;
      while (count > 0)
      {
         count -= stream.skip(count);
      }
   }
725903
public static void skip(long size, InputStream input) throws IOException {
        while (size > 0) {
            size -= input.skip(size);
        }
    }
41986
public void skip(K key) throws IOException {
    if (hasNext()) {
      while (cmp.compare(khead, key) <= 0 && next());
    }
  }