Protocol for accumulating bytes up to a specified length. This handles the case where no Transfer-Encoding is specified.

Instance Variable contentLength Counter keeping track of how many more bytes there are to receive.
Instance Variable dataCallback A one-argument callable which will be invoked each time application data is received.
Instance Variable finishCallback A one-argument callable which will be invoked when the terminal chunk is received. It will be invoked with all bytes which were delivered to this protocol which came after the terminal chunk.
Method __init__ Undocumented
Method dataReceived Interpret the next chunk of bytes received. Either deliver them to the data callback or invoke the finish callback if enough bytes have been received.
Method noMoreData All data which will be delivered to this decoder has been. Check to make sure as much data as was expected has been received.
contentLength =
Counter keeping track of how many more bytes there are to receive.
dataCallback =
A one-argument callable which will be invoked each time application data is received.
finishCallback =
A one-argument callable which will be invoked when the terminal chunk is received. It will be invoked with all bytes which were delivered to this protocol which came after the terminal chunk.
def __init__(self, contentLength, dataCallback, finishCallback): (source)
Undocumented
def dataReceived(self, data): (source)

Interpret the next chunk of bytes received. Either deliver them to the data callback or invoke the finish callback if enough bytes have been received.

RaisesRuntimeErrorIf the finish callback has already been invoked during a previous call to this methood.
def noMoreData(self): (source)

All data which will be delivered to this decoder has been. Check to make sure as much data as was expected has been received.

ReturnsNone
RaisesPotentialDataLossIf the content length is unknown.
_DataLossIf the content length is known and fewer than that many bytes have been delivered.
API Documentation for Twisted, generated by pydoctor at 2017-06-11 10:59:01.