'Write as much of this data as possible.
@returns: The number of bytes written.'

def _writeSomeData(self, data):

    if (self.consumer is None):
        return 0
    self.consumer.write(data)
    return len(data)
