private static void SaveInteger(Pickler /*!*/ pickler, object obj) { Debug.Assert(obj.GetType() == typeof(int), "arg must be int"); if (IsUInt8(obj)) { pickler.Write(Opcode.BinInt1); pickler.WriteUInt8(obj); } else if (IsUInt16(obj)) { pickler.Write(Opcode.BinInt2); pickler.WriteUInt16(obj); } else { pickler.Write(Opcode.BinInt); pickler.WriteInt32(obj); } }