You are here

public function Stream::tell in Lockr 7.3

Returns the current position of the file read/write pointer

Return value

int Position of the file pointer

Throws

\RuntimeException on error.

Overrides StreamInterface::tell

File

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

Class

Stream
PHP stream implementation.

Namespace

GuzzleHttp\Psr7

Code

public function tell() {
  if (!isset($this->stream)) {
    throw new \RuntimeException('Stream is detached');
  }
  $result = ftell($this->stream);
  if ($result === false) {
    throw new \RuntimeException('Unable to determine stream position');
  }
  return $result;
}