We need skip bytes to write when the remain bytes of current segment is not
enough to write binary row fixed part.
See {@link BinaryRow}.
336652
private int checkSkipWriteForFixLengthPart(AbstractPagedOutputView out) throws IOException {
		// skip if there is no enough size.
		int available = out.getSegmentSize() - out.getCurrentPositionInSegment();
		if (available < getSerializedRowFixedPartLength()) {
			out.advance();
			return available;
		}
		return 0;
	}
266346
public void prewrite(byte[] b,int offset, int length)
    {
        ensureReserve(length);
        System.arraycopy(b,offset,_buf,_start-length,length);
        _start-=length;
    }
899507
public static void setByte(MemorySegment[] segments, int offset, byte value) {
		if (inFirstSegment(segments, offset, 1)) {
			segments[0].put(offset, value);
		} else {
			setByteMultiSegments(segments, offset, value);
		}
	}
1226830
public void writeByteBufferPart(byte[] buffer, int offset, int length)
        throws IOException
    {
        while (length > 0) {
            int sublen = length;

            if (0x8000 < sublen)
                sublen = 0x8000;

            os.write('b');
            os.write(sublen >> 8);
            os.write(sublen);

            os.write(buffer, offset, sublen);

            length -= sublen;
            offset += sublen;
        }
    }
1030986
private boolean skipWhiteSpace(WsByteBuffer buff) {
        // keep reading until we hit the end of the buffer or a non-space char
        byte b;
        do {
            if (this.bytePosition >= this.byteLimit) {
                if (!fillByteCache(buff)) {
                    // not filled
                    return false;
                }
            }
            b = this.byteCache[this.bytePosition++];
        } while (BNFHeaders.SPACE == b || BNFHeaders.TAB == b);

        // move byte position back one.
        this.bytePosition--;
        return true;
    }
1284406
public int skipToBoundary() throws IOException {
		int count = 0;
		while (true) {
			byte b = readByte();
			count++;
			if (isBoundary(b)) {
				break;
			}
		}
		return count;
	}
870165
private void skip() {
        try {
            int blockSize;
            do {
                blockSize = read();
                rawData.position(rawData.position() + blockSize);
            } while (blockSize > 0);
        } catch (IllegalArgumentException ex) {
        }
    }
999802
@Override
    public long skip(long n) throws IOException {
        byte[] buf = new byte[(int)Math.min(n,64*1024)];
        return read(buf,0,buf.length);
    }
1213280
protected void skipPad() throws IOException {
		if (bytesRead > 0) {
			int extra = (int) (bytesRead % TarConstants.DATA_BLOCK);

			if (extra > 0) {
				long bs = 0;
				while (bs < TarConstants.DATA_BLOCK - extra) {
					long res = skip(TarConstants.DATA_BLOCK - extra - bs);
					bs += res;
				}
			}
		}
	}
961491
private void skipPE()
        throws XMLStreamException
    {
        skipDTDName();
        /* Should now get semicolon... let's try to find and skip it; but
         * if none found, let's not throw an exception -- we are just skipping
         * internal subset here.
         */
        char c = (mInputPtr < mInputEnd) ?
            mInputBuffer[mInputPtr++] : dtdNextFromCurr();
        if (c != ';') {
            --mInputPtr;
        }
    }
1369798
public long skip(long n) {
		long skipped=0L;
		int skip;
		while(n>0) {
			if(n<(skip=curr.remaining())) {
				curr.position(curr.position()+(int)n);
				skipped+=skip;
				n=0;
			} else {
				curr.position(curr.limit());
				
				skipped-=skip;
				if(idx<bbs.size()) {
					curr=bbs.get(idx++);
					n-=skip;
				} else {
					n=0;
				}
			}
		}
		return skipped;
	}
14946
@Override
  public long skip(long n)
    throws IOException
  {
    if (n <= 0) {
      return n;
    }
    
    long skipLen = 0;
    
    while (n > 0) {
      long sublen = Math.min(n, _readLength - _readOffset);

      if (sublen > 0) {
        _readOffset += sublen;

        skipLen += sublen;
        n -= sublen;
      }
      else {
        if (_source.hasSkip()) {
          _readOffset = _readLength = 0;
          
          long sourceSkipped = _source.skip(n);

          if (sourceSkipped <= 0) {
            return skipLen;
          }
          else {
            _position += sourceSkipped;
            skipLen += sourceSkipped;
            
            n -= sourceSkipped;
          }
        }
        else if (! readBuffer()) {
          return skipLen;
        }
      }
    }
    
    return skipLen;
  }
899033
@Override
	public long skip(long n) throws IOException {
		if (defaultSkip) {
			// use skip method of parent stream
			// may not work if skip not implemented by parent
			long bs = super.skip(n);
			bytesRead += bs;

			return bs;
		}

		if (n <= 0) {
			return 0;
		}

		long left = n;
		byte[] sBuff = new byte[SKIP_BUFFER_SIZE];

		while (left > 0) {
			int res = read(sBuff, 0, (int) (left < SKIP_BUFFER_SIZE ? left : SKIP_BUFFER_SIZE));
			if (res < 0) {
				break;
			}
			left -= res;
		}

		return n - left;
	}
184240
public static void skip(DataInput in) throws IOException {
    int length = in.readUnsignedShort();
    WritableUtils.skipFully(in, length);
  }
157636
public static long skip(final InputStream inputStream, final long bytesCount) throws IOException {
    Preconditions.checkNotNull(inputStream);
    Preconditions.checkArgument(bytesCount >= 0);

    long toSkip = bytesCount;
    while (toSkip > 0) {
      final long skipped = inputStream.skip(toSkip);
      if (skipped > 0) {
        toSkip -= skipped;
        continue;
      }

      if (inputStream.read() != -1) {
        toSkip--;
        continue;
      }
      return bytesCount - toSkip;
    }

    return bytesCount;
  }
1164535
public void serializeToPagesWithoutLength(
			BinaryRow record,
			AbstractPagedOutputView out) throws IOException {
		int remainSize = record.getSizeInBytes();
		int posInSegOfRecord = record.getOffset();
		int segmentSize = record.getSegments()[0].size();
		for (MemorySegment segOfRecord : record.getSegments()) {
			int nWrite = Math.min(segmentSize - posInSegOfRecord, remainSize);
			assert nWrite > 0;
			out.write(segOfRecord, posInSegOfRecord, nWrite);

			// next new segment.
			posInSegOfRecord = 0;
			remainSize -= nWrite;
			if (remainSize == 0) {
				break;
			}
		}
		checkArgument(remainSize == 0);
	}
273298
public void writeBytes(byte[] buffer)
        throws IOException
    {
        if (buffer == null) {
            if (SIZE < _offset + 16)
                flushBuffer();

            _buffer[_offset++] = 'N';
        }
        else
            writeBytes(buffer, 0, buffer.length);
    }