You are here

public function Stream::getSize in Auth0 Single Sign On 8.2

Get the size of the stream if known.

Return value

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

Overrides StreamInterface::getSize

File

vendor/guzzlehttp/psr7/src/Stream.php, line 125

Class

Stream
PHP stream implementation.

Namespace

GuzzleHttp\Psr7

Code

public function getSize() {
  if ($this->size !== null) {
    return $this->size;
  }
  if (!isset($this->stream)) {
    return null;
  }

  // Clear the stat cache if the stream has a URI
  if ($this->uri) {
    clearstatcache(true, $this->uri);
  }
  $stats = fstat($this->stream);
  if (isset($stats['size'])) {
    $this->size = $stats['size'];
    return $this->size;
  }
  return null;
}