Refactoring.

Now object serialized in StringBuilder first and then it write down to stream.