azure-storage-common/src/Common/Internal/Utilities.php
public static function isStreamLargerThanSizeOrNotSeekable(Stream $stream, $size)
    {
        Validate::isInteger($size, 'size');
        Validate::isTrue(
            $stream instanceof Stream,
            sprintf(Resources::INVALID_PARAM_MSG, 'stream', 'Guzzle\Stream')
        );
        $result = true;
        if ($stream->isSeekable()) {
            $position = $stream->tell();
            try {
                $stream->seek($size);
            } catch (\RuntimeException $e) {
                $pos = strpos(
                    $e->getMessage(),
                    'to seek to stream position '
                );
                if ($pos == null) {
                    throw $e;
                }
                $result = false;
            }
            if ($stream->eof()) {
                $result = false;
            } elseif ($stream->read(1) == '') {
                $result = false;
            }
            $stream->seek($position);
        }
        return $result;
    }
public static function isStreamLargerThanSizeOrNotSeekable(Stream $stream, $size)
    {
        Validate::isInteger($size, 'size');
        Validate::isTrue(
            $stream instanceof Stream,
            sprintf(Resources::INVALID_PARAM_MSG, 'stream', 'Guzzle\Stream')
        );
        $result = true;
        if ($stream->isSeekable()) {
            $position = $stream->tell();
            try {
                $stream->seek($size);
            } catch (\RuntimeException $e) {
                $pos = strpos(
                    $e->getMessage(),
                    'to seek to stream position '
                );
                if ($pos == null) {
                    throw $e;
                }
                $result = false;
            }
            if ($stream->eof()) {
                $result = false;
            } elseif ($stream->read(1) == '') {
                $result = false;
            }
            $stream->seek($position);
        }
        return $result;
    }
To evaluate if the stream is larger than a certain size. To restore
the stream, it has to be seekable, so will return true if the stream
is not seekable.
@param  Stream          $stream The stream to be evaluated.
@param  int             $size   The size if the string is larger than.

@return boolean         true if the stream is larger than the given size.