/// <summary> /// Read variable encoded 16-bit unsigned integer /// </summary> /// <exception cref="EndOfStreamException"/> public ushort ReadVarUInt16() { if (position >= end - IntegerHelper.MaxBytesVarInt16) { return((ushort)DecodeVarUInt64Checked()); } return(IntegerHelper.DecodeVarUInt16(buffer, ref position)); }