コード例 #1
0
 public static T FromProtoBuf <T>(this byte[] bytes)
 {
     using (var ms = new MemoryStream(bytes))
     {
         var obj = (T)ProtoBufFormat.Deserialize2 <T>(typeof(T), ms);
         return(obj);
     }
 }
コード例 #2
0
 public static T FromProtoBuf <T>(this Stream stream)
 {
     return((T)ProtoBufFormat.Deserialize2 <T>(typeof(T), stream));;
 }