Exemple #1
0
        public void Serialize(BinaryWriter writer, object portableObject, SerializationFlags serializationFlags)
        {
            var slotDestination = new SlotDestination();
            var pofWriter       = new PofWriter(context, slotDestination);

            if (serializationFlags.HasFlag(SerializationFlags.Typeless))
            {
                pofWriter.WriteObjectTypeless(0, portableObject);
            }
            else
            {
                pofWriter.WriteObject(0, portableObject);
            }

            var data = slotDestination[0];

            writer.Write((int)data.Length);
            writer.Write(data);
        }