guess embedded msg length; write embedded in place instead of temp buf