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;
}
}
}