Streamlined buffer code in writeMessage a bit more (always compact, no need to clear)