Return literal length data located at the end of the stream.

@return mixed  Null if no literal data found, or an array with these
keys:
- binary: (boolean) True if this is a literal8.
- length: (integer) Length of the literal.
777248
public function getLiteralLength()
    {
        if ($this->_stream->substring(-1, 1) === '}') {
            $literal_data = $this->_stream->getString(
                $this->_stream->search('{', true) - 1
            );
            $literal_len = substr($literal_data, 2, -1);

            if (is_numeric($literal_len)) {
                return array(
                    'binary' => ($literal_data[0] === '~'),
                    'length' => intval($literal_len)
                );
            }
        }

        return null;
    }
684209
public function readLong()
    {
        /**
         * Check, that we work in 64-bit mode.
         * fseek() uses long for offset. Thus, largest index segment file size in 32bit mode is 2Gb
         */
        if (PHP_INT_SIZE > 4) {
            $str = $this->_fread(8);

            return  ord($str[0]) << 56  |
                    ord($str[1]) << 48  |
                    ord($str[2]) << 40  |
                    ord($str[3]) << 32  |
                    ord($str[4]) << 24  |
                    ord($str[5]) << 16  |
                    ord($str[6]) << 8   |
                    ord($str[7]);
        } else {
            return $this->readLong32Bit();
        }
    }
835099
private function parseShortString()
    {
        $length = \ord($this->buffer);

        try {
            return mb_orig_substr($this->buffer, 1, $length);
        } finally {
            $this->buffer = mb_orig_substr($this->buffer, $length + 1);
        }
    }
1356161
public function readFloat()
    {
        try {
            $bin = $this->getStream()->read(8);

            return current(unpack('d', $bin));
        } catch (StreamException $e) {
            $this->handleStreamException($e, BinaryStreamAccessException::FLOAT);
        }
    }
831338
public function getLength()
        {
        	if(!$this->_hasGetLen) {
        		$this->_hasGetLen = true;
		        $this->_length = $this->_redis->llen($this->_key);
	        }
                return $this->_length;
        }
199749
public function readLong()
    {
        /**
         * Check, that we work in 64-bit mode.
         * fseek() uses long for offset. Thus, largest index segment file size in 32bit mode is 2Gb
         */
        if (PHP_INT_SIZE > 4) {
            $str = substr($this->_data, $this->_position, 8);
            $this->_position += 8;

            return  ord($str[0]) << 56  |
                    ord($str[1]) << 48  |
                    ord($str[2]) << 40  |
                    ord($str[3]) << 32  |
                    ord($str[4]) << 24  |
                    ord($str[5]) << 16  |
                    ord($str[6]) << 8   |
                    ord($str[7]);
        } else {
            return $this->readLong32Bit();
        }
    }
578556
public function getLength() : ?float 
    {
        if ( ! $this->hasLength()) {
            $this->setLength($this->getDefaultLength());
        }
        return $this->length;
    }
1073433
public function getLength()
    {
        if (!$this->stub && !is_int($this->length)) {
            $this->length = strlen($this->data);
        }

        return $this->length;
    }
853812
public function read($count)
    {
        $contentLength = strlen($this->data);
        if ($this->position > $contentLength || $count > $contentLength - $this->position) {
            throw new EndOfStreamException(
                sprintf(
                    'End of stream reached when trying to read %d bytes. content length=%d, position=%d',
                    $count,
                    $contentLength,
                    $this->position
                )
            );
        }

        $chunk = substr($this->data, $this->position, $count);
        if ($chunk === false) {
            $chunk = '';
        }

        $readBytes = strlen($chunk);
        $this->position += $readBytes;

        return $chunk;
    }
239336
public function getContents()
    {
        // If an offset is provided
        if ($this->offset !== -1) {
            // Seek to the offset
            $this->stream->seek($this->offset);
        }

        // If a max length is provided
        if ($this->maxLength !== -1) {
            // Read from the offset till the maxLength
            return $this->stream->read($this->maxLength);
        }

        return $this->stream->getContents();
    }
103825
public function readByte()
    {
        if (($this->_needle + 1) > $this->_streamLength) {
            throw new Exception(
                'Buffer underrun at needle position: '
                . $this->_needle
                . ' while requesting length: '
                . $this->_streamLength
            );
        }

        return ord($this->_stream{$this->_needle++});
    }
231145
public function readShort()
    {
        try {
            $bin = $this->getStream()->read(2);

            return current(unpack('S', $bin));
        } catch (StreamException $e) {
            $this->handleStreamException($e, BinaryStreamAccessException::SHORT);
        }
    }
112938
public function getContentLength(): ?int
    {
        $result = $this->getRequest()->getHeader('Content-Length');

        return $result ? (int) $result[0] : null;
    }
1317165
public function parse()
    {
        $bytes = (int) $this->data;
        if ($bytes < 0) {
            return null;
        }

        $bytes += 2; // CRLF
        $string = '';

        do {
            $buffer = $this->read($bytes);
            $string .= $buffer;
            $bytes -= strlen($buffer);
        } while ($bytes > 0);

        return substr($string, 0, -2); // Remove last CRLF
    }
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;
    }
882889
public function readInteger()
    {
        try {
            $bin = $this->getStream()->read(4);

            return current(unpack('l', $bin));
        } catch (StreamException $e) {
            $this->handleStreamException($e, BinaryStreamAccessException::INT);
        }
    }
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;
    }