fix: ostream::write will not be called if length of message text is equal to zero.
     istream::read and allocation of memory for text-buffer will not be called, if text-length is equal to zero.
fix: incorrect business-logic