protected function readAllGenHandler($cb, $size, &$offset, &$pri, &$buf)
    {
        return function ($file, $data) use ($cb, $size, &$offset, &$pri, &$buf) {
            $buf .= $data;
            $offset += mb_orig_strlen($data);
            $len = min($file->chunkSize, $size - $offset);
            if ($offset >= $size) {
                if ($cb) {
                    $cb($file, $buf);
                }
                return;
            }
            eio_read($file->fd, $len, $offset, $pri, $this->readAllGenHandler($cb, $size, $offset, $pri, $buf), $this);
        };
    }