Created
August 3, 2020 21:03
-
-
Save KDGundermann/85c63dffb5f018ac191cd09cf59e4197 to your computer and use it in GitHub Desktop.
ApexTest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using Apex.Serialization; | |
namespace ApexTestCore | |
{ | |
class EasyClass | |
{ | |
public int id; | |
public string name; | |
} | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
MemoryStream ms = new MemoryStream(); | |
var obj1 = new EasyClass { id = 1, name = "Uno" }; | |
var obj2 = new EasyClass { id = 2, name = "Dos" }; | |
var binSerializer = Binary.Create(new Settings().MarkSerializable(typeof(EasyClass))); | |
binSerializer.Write(obj1, ms); | |
binSerializer.Write(obj2, ms); | |
ms.Seek(0, SeekOrigin.Begin); | |
var obj1c = binSerializer.Read<EasyClass>(ms); | |
var obj2c = binSerializer.Read<EasyClass>(ms); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment