public function getSize()
    {
        $size = $this->stream->getSize();
        if ($size === null) {
            // this shouldn't happen on a seekable stream I don't think...
            $pos = $this->stream->tell();
            $this->stream->seek(0, SEEK_END);
            $size = $this->stream->tell();
            $this->stream->seek($pos);
        }
        if ($this->limit === -1) {
            return $size - $this->offset;
        } else {
            return min([$this->limit, $size - $this->offset]);
        }
    }
public function getSize()
    {
        $size = $this->stream->getSize();
        if ($size === null) {
            // this shouldn't happen on a seekable stream I don't think...
            $pos = $this->stream->tell();
            $this->stream->seek(0, SEEK_END);
            $size = $this->stream->tell();
            $this->stream->seek($pos);
        }
        if ($this->limit === -1) {
            return $size - $this->offset;
        } else {
            return min([$this->limit, $size - $this->offset]);
        }
    }
public function getSize ( ) { $ size = $ this -> stream -> getSize ( ) ; if ( $ size === null ) { // this shouldn't happen on a seekable stream I don't think... $ pos = $ this -> stream -> tell ( ) ; $ this -> stream -> seek ( 0 , SEEK_END ) ; $ size = $ this -> stream -> tell ( ) ; $ this -> stream -> seek ( $ pos ) ; } if ( $ this -> limit === - 1 ) { return $ size - $ this -> offset ; } else { return min ( [ $ this -> limit , $ size - $ this -> offset ] ) ; } }
Returns the size of the limited subset of data, or null if the wrapped
stream returns null for getSize.

@return int|null
Returns the size of the limited subset of data or null if the wrapped stream returns null for getSize .