Skip to content

Instantly share code, notes, and snippets.

@rogeralsing
Created November 13, 2016 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogeralsing/1bcd8f01061135c24eb1f5a0251f18ab to your computer and use it in GitHub Desktop.
Save rogeralsing/1bcd8f01061135c24eb1f5a0251f18ab to your computer and use it in GitHub Desktop.
private void SerializeZeroFormatter()
{
try
{
var s = new MemoryStream();
ZeroFormatterSerializer.Serialize(s, Value);
var bytes = s.ToArray();
RunTest("Zero Formatter", () =>
{
var stream = new MemoryStream();
ZeroFormatterSerializer.Serialize(stream, Value);
}, () =>
{
s.Position = 0;
var o = ZeroFormatterSerializer.Deserialize<T>(s);
}, bytes.Length);
}
catch(Exception x)
{
//ZF cannot handle most types in the testkit
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment