public void WriteAmfItem(ObjectEncoding objectEncoding, object data) { if (data == null) { this.WriteMarker(Amf0TypeMarkers.Null); } else { if (this.WriteAmf0ReferenceOnExistence(data)) { return; } Type type = data.GetType(); if (objectEncoding != ObjectEncoding.Amf0) { if (objectEncoding != ObjectEncoding.Amf3) { throw new ArgumentOutOfRangeException("objectEncoding"); } this.WriteMarker(Amf0TypeMarkers.Amf3Object); this.WriteAmf3Item(data); } else { AmfWriter.GetAmfWriter(AmfWriter.Amf0Writers, type).WriteData(this, data); } } }
public void WriteAmf3Item(object data) { if (data == null) { this.WriteAmf3Null(); } else { Type type = data.GetType(); AmfWriter.GetAmfWriter(AmfWriter.Amf3Writers, type).WriteData(this, data); } }
public void WriteAmf0Item(object data) { if (data == null) { this.WriteMarker(Amf0TypeMarkers.Null); } else { if (this.WriteAmf0ReferenceOnExistence(data)) { return; } Type type = data.GetType(); AmfWriter.GetAmfWriter(AmfWriter.Amf0Writers, type).WriteData(this, data); } }