internal static int SizeInBytes(object instance) { GetFormat(instance.GetType()); DummyStream s = new DummyStream(); GetSerializer(instance.GetType()).Serialize(s, instance); return((int)s.Length); }
// Get the m_size of the serialized stream for this type, in bytes. internal static int SizeInBytes(object instance) { Type t = instance.GetType(); Format k = GetFormat(t); DummyStream stream = new DummyStream(); Serializer ser = GetSerializer(instance.GetType()); ser.Serialize(stream, instance); return (int) stream.Length; }
// Get the m_size of the serialized stream for this type, in bytes. internal static int SizeInBytes(object instance) { Type t = instance.GetType(); Format k = GetFormat(t); DummyStream stream = new DummyStream(); Serializer ser = GetSerializer(instance.GetType()); ser.Serialize(stream, instance); return((int)stream.Length); }
internal static int SizeInBytes(object instance) { GetFormat(instance.GetType()); DummyStream s = new DummyStream(); GetSerializer(instance.GetType()).Serialize(s, instance); return (int) s.Length; }