Add debugger serialization and deserialization helpers

This commit is contained in:
Yoshi Askharoun
2023-06-02 00:08:56 -05:00
parent 1ae6b92cf9
commit 1dea74d1e5
2 changed files with 15 additions and 1 deletions
+7 -1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Sockets;
using System.Runtime.Serialization;
@@ -41,4 +40,11 @@ public static class DebugRemoting
return null;
}
}
internal static byte[] Serialize(this object obj, IFormatter formatter)
{
using MemoryStream dataStream = new();
formatter.Serialize(dataStream, obj);
return dataStream.ToArray();
}
}