'Retrieve data from the reply object.
Args:
maxlen maximum number of bytes to read (int)
Return:
bytestring containing the data'

def readData(self, maxlen):

    len_ = min(maxlen, len(self._data))
    buf = bytes(self._data[:len_])
    self._data = self._data[len_:]
    return buf
