Exemple #1
0
 public static byte[] ToBytes <T>(T obj) where T : new()
 {
     if (obj == null)
     {
         return(null);
     }
     Converter.ToBytesConvert toBytesConvert = new Converter.ToBytesConvert();
     Converter.ValueAction(toBytesConvert.Action, new Converter.ObjectDummyAccessor(obj), null);
     return(toBytesConvert.bytes);
 }
Exemple #2
0
 public static byte[] ToBytes(object obj)
 {
     if (obj == null)
     {
         return(null);
     }
     Converter.ToBytesConvert toBytesConvert = new Converter.ToBytesConvert();
     Converter.ValueAction(new Converter.ValueActionDelegate(toBytesConvert.Action), new Converter.ObjectDummyAccessor(obj), null);
     return(toBytesConvert.bytes);
 }