Return the length for read the stream, if null is return all the body will be print.

@throws ContainerExceptionInterface
@throws NotFoundExceptionInterface
421867
private static function streamReadLength(ContainerInterface $container): ? int
    {
        return $container->has(self::STREAM_READ_LENGTH) ? $container->get(self::STREAM_READ_LENGTH) : null;
    }
932941
public function getPosition(): int
    {
        if ( ! is_resource($this->stream) ) {
            throw new StreamException('Stream is not longer available');
        }

        $result = ftell($this->stream);

        if ( $result === false ) {
            throw new StreamException('Unable to determine stream position');
        }

        return $result;
    }
927749
public int length()
    {
        int length = description.length();
        synchronized (fields)
        {
            length = fields.stream().map(f -> f.getName().length() + f.getValue().length()).reduce(length, Integer::sum);
        }
        if (title != null)
            length += title.length();
        if (author != null)
            length += author.getName().length();
        if (footer != null)
            length += footer.getText().length();
        return length;
    }
599471
@Override
    public long length()
                    throws IOException {
        int len = physical.size();
        int answer = 0;
        for (int i = 0; i < len; i++) {
            RandomAccessFile raf = (RandomAccessFile) physical.get(i);
            if (raf != null) {
                answer += raf.length();
            }
        }
        return answer;
    }
1356161
public function readFloat()
    {
        try {
            $bin = $this->getStream()->read(8);

            return current(unpack('d', $bin));
        } catch (StreamException $e) {
            $this->handleStreamException($e, BinaryStreamAccessException::FLOAT);
        }
    }
203682
public function getContentLength() {
        $contentLengthKey = OSSHeaders::CONTENT_LENGTH;
        if (isset($this->metadata[$contentLengthKey])) {
            return (int) $this->metadata[$contentLengthKey];
        }

        // mitmproxy's bug, return 'content-length' when head a request.
        $contentLengthKey = strtolower($contentLengthKey);
        if (isset($this->metadata[$contentLengthKey])) {
            return (int) $this->metadata[$contentLengthKey];
        }

        return (int) 0;
    }
315692
public function getBodyWrapLength(): int
    {
        if (count($this->commitMessage) < 3) {
            return 0;
        }

        $body = array_slice($this->commitMessage, 2);
        $longestLineLength = 0;

        foreach ($body as $line) {
            if (strlen($line) > $longestLineLength) {
                $longestLineLength = strlen($line);
            }
        }

        return $longestLineLength;
    }
468795
public int getArrayLength() throws ReflectorException  {
		
		if(object == null) {
			logger.error("object is null: did you specify it using the 'inspect()' method?");
			throw new ReflectorException("object is null: did you specify it using the 'inspect()' method?");
		}
		
		int length = 0;
		if(object.getClass().isArray()) {
			length = Array.getLength(object);
		} else if (object instanceof List<?>){
			length = ((List<?>)object).size();
		} else {
			throw new ReflectorException("object is not an array or a list");
		}
		return length;
	}
191246
@Override
	public int getSize()
    {
    	int size = 0;
    	subscriptionsLock.readLock().lock();
    	try
        {
    		for(LocalTopicSubscription subscription : subscriptionMap.values())
        	{
                size += subscription.getLocalQueue().getSize();
            }
        }
    	finally
    	{
    		subscriptionsLock.readLock().unlock();
    	}
    	
    	return size;
    }
322341
@InterfaceAudience.Public
    public long getLength() {
        Number length = (Number) metadata.get("length");
        if (length != null) {
            return length.longValue();
        } else {
            return 0;
        }
    }
31439
public function getContentLength()
    {
        if (null !== $this->requestStack && null !== $request = $this->requestStack->getCurrentRequest()) {
            return $request->server->get('CONTENT_LENGTH');
        }

        return isset($_SERVER['CONTENT_LENGTH'])
            ? (int) $_SERVER['CONTENT_LENGTH']
            : null;
    }
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++});
    }
841040
@Override
    public int read() throws IOException {
        final int c = super.read();
        if (c >= 0)
            dataLength++;
        checkLength(c == -1);
        return c;
    }
141804
public function getSize()
    {
        if (!$this->stream) {
            return null;
        }

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

        return null;
    }
21494
public int getLength()
  {
    int length = 0;
    
    for (TempCharBuffer ptr = _head; ptr != null; ptr = ptr._next) {
      length += ptr.getLength();
    }

    return length;
  }
1123397
public function tell(): int
    {
        if ($this->isAttached() === false || ($position = ftell($this->stream)) === false) {
            throw new RuntimeException('Could not get the position of the pointer in stream');
        }

        return $position;
    }
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;
    }