Read length bytes from name’s stderr log starting at offset

@param integer $offset offset to start reading from
@param integer $length number of bytes to read from the log

@return string Bytes of log
765416
public function readProcessStderrLog($offset, $length)
    {
        return $this->rpcClient->call('supervisor.readProcessStderrLog', array($this->processGroup.':'.$this->processName, $offset, $length));
    }
1034652
public function readBytes($length)
    {
        if ($this->offset == $this->array_size) {
            return false;
        }
        $arrays = [];
        $end = $length + $this->offset;
        for ($i = $this->offset; $i < $end; ++$i) {
            if (!isset($this->array[$i])) {
                break;
            }
            $arrays[] = $this->array[$i];
        }
        $this->offset += ($i - $this->offset); // Limit function calls

        return array_merge(...$arrays);
    }
202814
public function read($length)
    {
        $buffer = '';
        $total = count($this->streams) - 1;
        $remaining = $length;
        $progressToNext = false;

        while ($remaining > 0) {

            // Progress to the next stream if needed.
            if ($progressToNext || $this->streams[$this->current]->eof()) {
                $progressToNext = false;
                if ($this->current === $total) {
                    break;
                }
                $this->current++;
            }

            $result = $this->streams[$this->current]->read($remaining);

            // Using a loose comparison here to match on '', false, and null
            if ($result == null) {
                $progressToNext = true;
                continue;
            }

            $buffer .= $result;
            $remaining = $length - strlen($buffer);
        }

        $this->pos += strlen($buffer);

        return $buffer;
    }
914510
public function getSlice($offset, $length)
    {
        $childrenTags = $this->tagsService->loadTagChildren($this->tag, $offset, $length);

        if (!isset($this->nbResults)) {
            $this->nbResults = $this->tagsService->getTagChildrenCount($this->tag);
        }

        return $childrenTags;
    }
566682
public function getSlice($offset, $length)
    {
        $this->resultSet = $this->searchable->search($this->query, array(
            'from' => $offset,
            'size' => $length
        ));

        return $this->convertResultSet($this->resultSet);
    }
904687
public function read($length)
    {
        $pos = $this->stream->tell();
        $ret = $this->seekAndRead($length);
        $this->position += strlen($ret);
        $this->stream->seek($pos);
        if ($this->limit !== -1 && $this->position > $this->limit) {
            $ret = substr($ret, 0, -($this->position - $this->limit));
            $this->position = $this->limit;
        }
        return $ret;
    }
904836
public function read($length)
    {
        if ($this->deadline) {
            stream_set_timeout($this->socket, max($this->deadline - time(), 1));
        }

        // Note: For correct behaviour, $length should be the same at the
        // PHP stream chunk size. For all PHP < 5.4 this is 8192. Other values
        // will cause PHP's internal stream buffer to be used and break
        // stream_select() semantics. See https://bugs.php.net/bug.php?id=52602
        $data = fread($this->socket, $length);

        $this->checkTimeout();
        return $data;
    }
1036484
public function slice($offset, $length = null)
    {
        $clone = clone $this;
        $clone->members = array_slice($clone->members, $offset, $length);
        return $clone;
    }
119774
public function read(int $length = 8192): string
    {
        $bytes           = substr($this->buffer, $this->position, $length);
        $this->position += strlen($bytes);
        return $bytes;
    }
566761
public function getSlice($offset, $length)
    {
        $query = clone $this->query;
        $query->offset = $offset;
        $query->limit = $length;
        $query->performCount = false;

        $searchResult = $this->searchService->findLocations($query, $this->languageFilter);

        // Set count for further use if returned by search engine despite !performCount (Solr, ES)
        if (!isset($this->nbResults) && isset($searchResult->totalCount)) {
            $this->nbResults = $searchResult->totalCount;
        }

        return $searchResult->searchHits;
    }
1084338
public function readProcessStdoutLog($offset, $length)
    {
        return $this->rpcClient->call('supervisor.readProcessStdoutLog', array($this->processGroup.':'.$this->processName, $offset, $length));
    }
233692
function recv($length)
    {
        $content = '';
        $readn = $length;

        while ($readn > 0)
        {
            if ($readn > 8192)
            {
                $tmp = fread($this->fp, 8192);
            }
            else
            {
                $tmp = fread($this->fp, $readn);
            }
            if (empty($tmp))
            {
                break;
            }
            $content .= $tmp;
            $readn -= strlen($tmp);
        }
        return $content;
    }
16619
static function read($fp,$length)
    {
        $data = '';
        while($buf = fread($fp, $length))
        {
            $data .= $buf;
            if(strlen($buf) < $length) break;
        }
        return $data;
    }
1025942
public function read($length)
    {
        $index = 0;
        $contents = '';
        while ($this->iterator->valid() && $index < $length) {
            if ($this->stringify !== null) {
                $contents .= $this->stringify->call($this, $this->iterator->current());
            } else {
                $contents .= $this->iterator->current();
            }

            $this->iterator->next();
            ++$this->position;
            ++$index;
        }

        return $contents;
    }
856666
public function slice(int $offset, int $length = null):ByteArray{

		// keep an extended class
		/** @var \chillerlan\Traits\ArrayHelpers\ByteArray $slice */
		$slice  = (new ReflectionClass($this))->newInstanceArgs([$length ?? ($this->count() - $offset)]);

		foreach($slice as $i => $_){
			$slice[$i] = $this[$offset + $i];
		}

		return $slice;
	}
246015
public function readBytes($length)
    {
        $read = $this->read($length);
        if (false !== $read) {
            $ret = array_map('ord', str_split($read, 1));

            return $ret;
        }

        return false;
    }
782980
public function read($length)
    {
        if ($this->offset == $this->array_size) {
            return false;
        }

        // Don't use array slice
        $arrays = [];
        $end = $length + $this->offset;
        for ($i = $this->offset; $i < $end; ++$i) {
            if (!isset($this->array[$i])) {
                break;
            }
            $arrays[] = $this->array[$i];
        }
        $this->offset += $i - $this->offset; // Limit function calls
        $chars = false;
        foreach ($arrays as $array) {
            $chars .= implode('', array_map('chr', $array));
        }

        return $chars;
    }