src/Message/Stream/AbstractStream.php
public function getSize()
    {
        if (is_null($this->stream)) {
            return null;
        }

        $stats = fstat($this->stream);
        return $stats['size'];
    }
public function getSize()
    {
        if (is_null($this->stream)) {
            return null;
        }

        $stats = fstat($this->stream);
        return $stats['size'];
    }
Get the size of the stream if known.

@return int|null Returns the size in bytes if known, or null if unknown.