'Reliably write some data.
The data is buffered until his file descriptor is ready for writing.'

def write(self, data):

    if isinstance(data, unicode):
        raise TypeError('Data    must    not    be    unicode')
    if ((not self.connected) or self._writeDisconnected):
        return
    if data:
        self._tempDataBuffer.append(data)
        self._tempDataLen += len(data)
        if ((self.producer is not None) and self.streamingProducer):
            if ((len(self.dataBuffer) + self._tempDataLen) > self.writeBufferSize):
                self.producerPaused = True
                self.producer.pauseProducing()
        self.startWriting()
