def METHOD_NAME(self, size: int):
    b = bytes(0)
    while size:
        got = os.read(self.readFd, size)
        if not len(got):
            self.executor.shutdown(False)
            raise Exception('rpc end of stream reached')
        size -= len(got)
        b += got
    return b