ADBaseLibrary.Matroska.MatroskaExtensions.Ebml_Read_Uint C# (CSharp) Method

Ebml_Read_Uint() public static method

public static Ebml_Read_Uint ( this reader, int size, ulong &number ) : int
reader this
size int
number ulong
return int
        public static int Ebml_Read_Uint(this BinaryReader reader, int size, out ulong number)
        {
            int n = 0;
            if (size > 8)
                throw new ArgumentException("Invalid size");
            number = 0;
            while (n++ < size)
            {
                byte b = reader.ReadByte();
                number = (number << 8) |  b;
            }
            return 0;
        }