Serialize streams with properties for c#, c++