System.StreamExtensions.SkipBytes C# (CSharp) Méthode

SkipBytes() public static méthode

public static SkipBytes ( this stream, int byteCount ) : void
stream this
byteCount int
Résultat void
        public static void SkipBytes(this Stream stream, int byteCount)
        {
            var buffer = Buffer;
            while (byteCount > 0)
            {
                int toRead= (byteCount > buffer.Length) ? buffer.Length : byteCount;
                stream.Read(buffer, 0, toRead);
                byteCount -= toRead;
            }
        }