class documentation
class LengthEnforcingConsumer: (source)
Constructor: LengthEnforcingConsumer(producer, consumer, finished)
An IConsumer
proxy which enforces an exact length requirement on the total data written to it.
Method | __init__ |
Undocumented |
Method | write |
Write bytes to the underlying consumer unless _noMoreWritesExpected has been called or there are/have been too many bytes. |
Method | _allow |
Indicate that no additional writes are allowed. Attempts to write after calling this method will be met with an exception. |
Method | _no |
Called to indicate no more bytes will be written to this consumer. Check to see that the correct number have been written. |
Instance Variable | _consumer |
The consumer to which at most _length bytes will be forwarded. |
Instance Variable | _finished |
A Deferred which will be fired with a Failure if too many bytes are written to this consumer. |
Instance Variable | _length |
The number of bytes remaining to be written. |
Instance Variable | _producer |
The IBodyProducer which is writing to this consumer. |
Write bytes to the underlying consumer unless _noMoreWritesExpected has been called or there are/have been too many bytes.
Indicate that no additional writes are allowed. Attempts to write after calling this method will be met with an exception.
Called to indicate no more bytes will be written to this consumer. Check to see that the correct number have been written.
Raises | |
WrongBodyLength | If not enough bytes have been written. |