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); } }
public static T FromProtoBuf <T>(this Stream stream) { return((T)ProtoBufFormat.Deserialize2 <T>(typeof(T), stream));; }