Part of bzrlib.smart.protocol View In Hierarchy
Subclasses should provide a self.state_accept attribute that accepts bytes and, if appropriate, updates self.state_accept to a different function. accept_bytes will call state_accept as often as necessary to make sure the state machine has progressed as far as possible before it returns.
See ProtocolThreeDecoder for an example subclass.
|Method||accept_bytes||Decode as much of bytes as possible.|
|Method||_get_in_bytes||Grab X bytes from the input_buffer.|
Callers should have already checked that self._in_buffer_len is > count. Note, this does not consume the bytes from the buffer. The caller will still need to call _get_in_buffer() and then _set_in_buffer() if they actually need to consume the bytes.
If 'bytes' contains too much data it will be appended to self.unused_data.
finished_reading will be set when no more data is required. Further data will be appended to self.unused_data.