Lucene.Net.Store.DataInput.SkipBytes C# (CSharp) Method

SkipBytes() public method

Skip over numBytes bytes. The contract on this method is that it should have the same behavior as reading the same number of bytes into a buffer and discarding its content. Negative values of numBytes are not supported.
public SkipBytes ( long numBytes ) : void
numBytes long
return void
        public virtual void SkipBytes(long numBytes)
        {
            if (numBytes < 0)
            {
                throw new System.ArgumentException("numBytes must be >= 0, got " + numBytes);
            }
            if (SkipBuffer == null)
            {
                SkipBuffer = new byte[SKIP_BUFFER_SIZE];
            }
            Debug.Assert(SkipBuffer.Length == SKIP_BUFFER_SIZE);
            for (long skipped = 0; skipped < numBytes; )
            {
                var step = (int)Math.Min(SKIP_BUFFER_SIZE, numBytes - skipped);
                ReadBytes(SkipBuffer, 0, step, false);
                skipped += step;
            }
        }
    }