public static SimpleObjectSerializer Serialize(object o, Stream s) { var os = new SimpleObjectSerializer(o); os.SerializeTo(s); return(os); }
public bool Serialize(SimpleObjectSerializer serializer) { serializer.Writer.Write((UInt16)Count); if (Count == 0) { return(true); } if (compacter == null) { var chars = new List <char>(); foreach (var s in list) { foreach (var c in s) { if (!chars.Contains(c)) { chars.Add(c); } } } compacter = new StringCompacter(chars); } serializer.Writer.Write(new string(compacter.GetChars())); foreach (var s in list) { serializer.Writer.Write(compacter.Serialize(s)); } return(true); }
internal void Serialize(SimpleObjectSerializer s) { var w = s.Writer; if (Strings.Count > 0) { w.Write(TypeCodeCompressedStringCollection); Strings.Serialize(s); } if (types.Count > 0) { w.Write(TypeCodeTypeCollection); w.Write((UInt16)types.Count); for (int i = 0; i < types.Count; i++) { w.Write((UInt16)types[i].StringIndex); } } }
public static byte[] Serialize(object o, SimpleObjectFieldSerializationMode FieldMode) { var os = new SimpleObjectSerializer(o, FieldMode); return(os.Serialize()); }
public static byte[] Serialize(object o) { var os = new SimpleObjectSerializer(o); return(os.Serialize()); }
bool ICustomSerializer.Initialize(SimpleObjectSerializer s) { return(true); }