Implement message writer.

synchronized ?