public void SerializeAs(Stream stream, object obj, Type type) { using (LiteBinaryWriter writer = new LiteBinaryWriter(stream, Encoding.Default, _serializationContext)) { writer.WriteObjectAs(type, obj); } }
public override void Write(LiteBinaryWriter writer, object graph) { // Type enumType = Enum.GetUnderlyingType(ActualType); // ILiteSerializationSurrogate typeSurr = writer.Context.SurrogateSelector.GetSurrogateForType(enumType); // writer.Write(typeSurr.TypeHandle); // typeSurr.Write(writer, graph); }
public override void WriteTo(LiteBinaryWriter writer, object obj) { Int32[] array = (Int32[])obj; writer.Write(array.Length); for (int i = 0; i < array.Length; i++) { writer.Write(array[i]); } }
public override void WriteTo(LiteBinaryWriter writer, object obj) { Array array = (Array)obj; writer.Write(array.Length); for (int i = 0; i < array.Length; i++) { writer.WriteObject(array.GetValue(i)); } }
public override void WriteTo(LiteBinaryWriter writer, object obj) { IList list = (IList)obj; writer.Write(list.Count); for (int i = 0; i < list.Count; i++) { writer.WriteObject(list[i]); } }
public override void WriteTo(LiteBinaryWriter writer, object obj) { IDictionary dict = (IDictionary)obj; writer.Write(dict.Count); for (IDictionaryEnumerator i = dict.GetEnumerator(); i.MoveNext();) { writer.WriteObject(i.Key); writer.WriteObject(i.Value); } }
public sealed override void Write(LiteBinaryWriter writer, object obj) { int cookie = writer.SerializationContext.GetCookie(obj); if (cookie != LiteSerializationContext.InvalidCookie) { writer.Write(cookie); return; } cookie = writer.SerializationContext.CacheObjectForWrite(obj); writer.Write(cookie); WriteTo(writer, obj); }
public override void Write(LiteBinaryWriter writer, object obj) { int cookie = writer.SerializationContext.GetCookie(obj); if (cookie != LiteSerializationContext.InvalidCookie) { writer.Write(cookie); return; } cookie = writer.SerializationContext.CacheObjectForWrite(obj); writer.Write(cookie); _formatter.Serialize(writer.BaseStream, obj); }
public override void Write(LiteBinaryWriter writer, object obj) { writer.Write((DateTime)obj); }
public override void Write(LiteBinaryWriter writer, object obj) { writer.Write((String)obj); }
public override void Write(LiteBinaryWriter writer, object obj) { writer.Write((Decimal)obj); }
public virtual void Write(LiteBinaryWriter writer, object obj) { }
public abstract void WriteTo(LiteBinaryWriter writer, object obj);
public override void WriteTo(LiteBinaryWriter writer, object obj) { ((ILiteSerializable)obj).Serialize(writer); }
public override void Write(LiteBinaryWriter writer, object obj) { writer.Write((Int16)obj); }
public override void Write(LiteBinaryWriter writer, object obj) { writer.Write((Boolean)obj); }