@Override
  public long skip(long byteCount) throws IOException {
    Preconditions.checkState(mBufferOffset <= mBufferedSize);
    ensureNotClosed();
    final int bytesLeftInBuffer = mBufferedSize - mBufferOffset;
    if (bytesLeftInBuffer >= byteCount) {
      mBufferOffset += byteCount;
      return byteCount;
    }

    mBufferOffset = mBufferedSize;
    return bytesLeftInBuffer + mInputStream.skip(byteCount - bytesLeftInBuffer);
  }
position of next buffered byte in mByteArray to be read

<p>invariant: 0 <= mBufferOffset <= mBufferedSize
fbcore/src/main/java/com/facebook/common/memory/PooledByteArrayBufferedInputStream.java