'Sets up variables necessary for consuming the payload of a netstring.'

def _prepareForPayloadConsumption(self):

    self._state = self._PARSING_PAYLOAD
    self._currentPayloadSize = 0
    self._payload.seek(0)
    self._payload.truncate()
