@adeln: that code will use reflection to write the properties defined by the primary c'tor to the stream. it ignores most things you'd want in a good/professional serialiser, like support for data evolution, use of bytecode synthesis for extra performance, etc.