'Write C{bytes} to the underlying consumer unless
C{_noMoreWritesExpected} has been called or there are/have been too
many bytes.'

def write(self, bytes):

    if (self._finished is None):
        self._producer.stopProducing()
        raise ExcessWrite()
    if (len(bytes) <= self._length):
        self._length -= len(bytes)
        self._consumer.write(bytes)
    else:
        _callAppFunction(self._producer.stopProducing)
        self._finished.errback(WrongBodyLength(u'too    many    bytes    written'))
        self._allowNoMoreWrites()
