Example #1
0
 public static void Deserialize(byte[] buffer, long ofs, object graph)
 {
     if (ListUtils.IsNullOrEmpty <byte>(buffer))
     {
         throw new ArgumentException();
     }
     FixedLengthFormatter.Deserialize(Marshal.UnsafeAddrOfPinnedArrayElement(buffer, 0), ofs, graph);
 }
Example #2
0
 public static byte[] Serialize(object graph)
 {
     if (graph == null)
     {
         throw new ArgumentNullException("graph");
     }
     byte[] buffer = new byte[FixedLengthFormatter.SizeOf(graph)];
     Marshal.StructureToPtr(graph, Marshal.UnsafeAddrOfPinnedArrayElement(buffer, 0), true);
     return(buffer);
 }
Example #3
0
 public static T Deserialize <T>(byte[] buffer)
 {
     return(FixedLengthFormatter.Deserialize <T>(buffer, 0));
 }
Example #4
0
 public static void Deserialize(byte[] buffer, object graph)
 {
     FixedLengthFormatter.Deserialize(buffer, 0, graph);
 }
Example #5
0
 public static void Deserialize(IntPtr ptr, object graph)
 {
     FixedLengthFormatter.Deserialize(ptr, 0, graph);
 }