src/UploadedFile.php
public function getStream()
    {
        if ($this->hasMoved()) {
            throw new \RuntimeException(sprintf('Uploaded file "%s" has already moved', $this->file));
        }

        if (is_null($this->stream)) {
            $this->stream = new Stream(fopen($this->file, 'r'));
        }

        return $this->stream;
    }
public function getStream()
    {
        if ($this->hasMoved()) {
            throw new \RuntimeException(sprintf('Uploaded file "%s" has already moved', $this->file));
        }

        if (is_null($this->stream)) {
            $this->stream = new Stream(fopen($this->file, 'r'));
        }

        return $this->stream;
    }
Retrieve a stream representing the uploaded file.

This method MUST return a StreamInterface instance, representing the
uploaded file. The purpose of this method is to allow utilizing native PHP
stream functionality to manipulate the file upload, such as
stream_copy_to_stream() (though the result will need to be decorated in a
native PHP stream wrapper to work with such functions).

If the moveTo() method has been called previously, this method MUST raise
an exception.

@return StreamInterface Stream representation of the uploaded file.
@throws \RuntimeException in cases when no stream is available or can be
created.