void IExternalizable.WriteExternal(IExternalWriter writer) { writer.WriteByte(Amf3Type.Object); if (writer.WriteReference(this)) return; //动态对象方式 writer.WriteByte(0x0b); writer.WriteByte(0x01); this.WriteAmf3(writer); writer.WriteByte(0x01); }
/// <summary> /// 以最大值/当前值的方式写入数据 /// </summary> /// <param name="writer"></param> /// <param name="m"></param> /// <param name="v"></param> public static void WritePair(IExternalWriter writer, int m, int v) { writer.WriteByte(Amf3Type.Object); writer.WriteByte(0x0b); //动态对象方式. writer.WriteByte(0x01); writer.WriteKey("M"); writer.WriteInt(m); writer.WriteKey("V"); writer.WriteInt(v); writer.WriteByte(0x01); }