'Get the pending writes from this transport, clearing them from the
pending buffer.
@return: the bytes written with C{transport.write}
@rtype: L{bytes}'

def getOutBuffer(self):

    S = self.stream
    if S:
        self.stream = []
        return ''.join(S)
    elif (self.tls is not None):
        if self.tls.readyToSend:
            self.tls.sent = True
            return self.tls
        else:
            return None
    else:
        return None
