Implemented message length writing.