avoid io.WriteString since writer is known to be bufio.Writer