#pragma warning disable CS0675 // Bitwise-or operator used on a sign-extended operand /// <summary> /// Reads the next VINT from a stream, does not cut the leading 1. /// </summary> public static long ReadTag(Stream reader) { int first = reader.ReadByte(); int extraBytes = QMath.LeadingZerosInByte(first); long value = first; for (int i = 0; i < extraBytes; ++i) { value = (value << 8) | reader.ReadByte(); } return(value); }