コード例 #1
0
        internal static int SizeInBytes(object instance)
        {
            GetFormat(instance.GetType());
            DummyStream s = new DummyStream();

            GetSerializer(instance.GetType()).Serialize(s, instance);
            return((int)s.Length);
        }
コード例 #2
0
 // 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;
 }
コード例 #3
0
ファイル: SqlSer.cs プロジェクト: pgovind/runtime
        // 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;
 }