public function read($size = 1024)
    {
        if (!is_resource($this->read)) {
            $this->read = fopen($this->filename, 'r+');
            if (!is_resource($this->read)) {
                throw new \RuntimeException('open file failed');
            }
            if (!$this->block) {
                $set = stream_set_blocking($this->read, false);
                if (!$set) {
                    throw new \RuntimeException('stream_set_blocking failed');
                }
            }
        }

        return fread($this->read, $size);
    }