Get the size of the stream if known.

@return int|null Returns the size in bytes if known, or null if unknown.
@throws \TypeError
487175
public function getSize()
    {
        if (!$this->size && $this->isAttached() === true) {
            if (!\is_resource($this->stream)) {
                throw new \TypeError();
            }
            $stats = \fstat($this->stream);
            /** @var int|null size */
            $this->size = isset($stats['size']) && !$this->isPipe() ? (int) $stats['size'] : null;
        }

        return $this->size;
    }
431445
function getSize()
    {
        if (!$this->_assertUsable())
            return null;

        $size  = null;
        if ($uri = $this->getMetadata('uri'))
            ## clear the stat cache of stream URI
            clearstatcache(true, $uri);

        $stats = fstat($this->rHandler);
        if (isset($stats['size']))
            $size = $stats['size'];

        return $size;
    }
403003
public function size(): int {
        $size = 0;
        /**
         * @var string $hash
         * @var  AbstractLinkedList $list
         */
        foreach ($this->bucket as $hash => $list) {
            $size += $list->size();
        }
        return $size;
    }
141804
public function getSize()
    {
        if (!$this->stream) {
            return null;
        }

        $stats = fstat($this->stream);
        if (isset($stats['size'])) {
            return $stats['size'];
        }

        return null;
    }
255235
def size(self):
        
        pos = self._stream.tell()
        # seek to the end of the stream
        self._stream.seek(0,2)
        size = self._stream.tell()
        self._stream.seek(pos, 0)

        return size
166861
public function stream_stat()
    {
        $statistics = $this->fileStatisticsTemplate();

        if ($this->_download !== null) {
            $statistics[7] = $statistics['size'] = $this->_download->getSize();
        }
        if ($this->_upload !== null) {
            $statistics[7] = $statistics['size'] = $this->_pointerOffset;
        }

        return $statistics;
    }
682296
public function getSize()
    {
        if (!$this->isClosed()) {
            $stat = fstat($this->handle);
        }
        
        return isset($stat['size']) ? $stat['size'] : null;
    }
544804
public function getWidth()
    {
        if ($this->width === null) {
            $this->width = intval($this->systemCall('tput cols'));
        }

        return $this->width;
    }
1014826
public function getSize()
    {
        if ($this->size === null && $this->storage->supportsSize()) {
            $this->size = $this->storage->getSize($this->key);
        }

        return $this->size;
    }
1186210
public function getSize() : int
    {
        $files = $this->getFiles();
        $size = 0;
        foreach($files as $file) {
            $size += $file->getSize();
        }
        return $size;
    }
499854
private function getHeaderSize()
    {
        // reset stream pointer to 0
        fseek($this->_stream, 0);
        // check for Aldus placeable metafile header
        // L: vorzeichenloser Long-Typ (immer 32 Bit, Byte-Folge maschinenabhängig)
        // magic:
        $magic = fread($this->_stream, 4);
        $headerSize = 18; // WMF header
        if ($magic == "\xd7\xcd\xc6\x9a") {
            $this->_headerStartBytesFound = true;
            $headerSize += 22; // Aldus header
        }
        return $headerSize;
    }
1237659
public function getWidth()
    {
        $width = getenv('COLUMNS');
        if (false !== $width) {
            return (int) trim($width);
        }

        if (null === self::$width) {
            self::initDimensions();
        }

        return self::$width ?: 80;
    }
415827
def get_size(self):
    
    if not self._is_open:
      raise IOError('Not opened.')

    if self._decrypted_stream_size is None:
      self._decrypted_stream_size = self._GetDecryptedStreamSize()

    return self._decrypted_stream_size
164346
public function size()
    {
        $position = ftell($this->_fileHandle);
        fseek($this->_fileHandle, 0, SEEK_END);
        $size = ftell($this->_fileHandle);
        fseek($this->_fileHandle, $position);

        return $size;
    }
167167
public function getNormalizeResponseChunkSize() : int
    {
        $chunkSize      = $this->getConfiguration('responseChunkSize', static::DEFAULT_CHUNK_SIZE);
        $chunkSize      = ! is_numeric($chunkSize) ? static::DEFAULT_CHUNK_SIZE : intval(abs($chunkSize));
        $chunkSize      = $chunkSize < 512 ? 512 : $chunkSize;
        return $chunkSize;
    }
999797
public function length()
    {
        $length = 0;

        foreach ($this->_streams as $stream) {
            $len = $stream->length();
            if ($len === null) {
                return;
            }
            $length += $len;
        }
        return $length;
    }
986560
public function getWidth()
    {
      if ($this->width != null) {
        return $this->width;
      }

      list($width) = getimagesize($this->_files['tmp_name']);

      return $width;
    }