If I have a class without any variable sized objects (e.g. strings, lists, etc.), is there some utility function in the MessagePack library to compute the size of the binary representation of the object?
Example class:
[MessagePackObject]
class Foo {
[Key(0)]
public int A { get; set; }
[Key(1)]
public float B { get; set; }
}
My current best bet is to simply serialize an object and measure it's length.
Pass the final object to a helper method to get the bytes used, i.e.;
And the extension method;