def _write(self, data, newline=False):
        if newline:
            data = "%s\n" % data
        self._stream.write(data)