@Override
  public int skipBytes(int n) {
    int newPosition = buffer.position() + n;
    if (newPosition > buffer.limit()) {
      newPosition = buffer.limit();
      n = newPosition - buffer.position();
    }
    buffer.position(newPosition);
    return n;
  }
See the InputStream read method for javadocs. Note that if an attempt to read past the end of
the wrapped ByteBuffer is done this method throws BufferUnderflowException
geode-core/src/main/java/org/apache/geode/internal/tcp/ByteBufferInputStream.java