def write(self, data):
        assert self.outputStream is not None, "Not setup for write!"
        self._lock()
        try:
            self.outputStream.write(data, len(data))
        finally:
            self._release()