src/Valkyrja/HttpMessage/NativeStream.php
public function getSize(): ? int
    {
        $fstat = null;

        // If the stream isn't set
        if (null === $this->stream) {
            // Return without attempting to get the fstat
            return $fstat;
        }

        // Get the stream's fstat
        $fstat = fstat($this->stream);

        return $fstat['size'];
    }
public function getSize(): ? int
    {
        $fstat = null;

        // If the stream isn't set
        if (null === $this->stream) {
            // Return without attempting to get the fstat
            return $fstat;
        }

        // Get the stream's fstat
        $fstat = fstat($this->stream);

        return $fstat['size'];
    }
Get the size of the stream if known.

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