Lines Matching refs:limit
17 private $limit;
21 * @param int $limit Total number of bytes to allow to be read
22 * from the stream. Pass -1 for no limit.
28 $limit = -1,
32 $this->setLimit($limit);
43 // No limit and the underlying stream is not at EOF
44 if ($this->limit == -1) {
53 return $tell >= $this->offset + $this->limit;
64 } elseif ($this->limit == -1) {
67 return min($this->limit, $length - $this->offset);
83 if ($this->limit !== -1) {
84 if ($offset > $this->offset + $this->limit) {
85 $offset = $this->offset + $this->limit;
130 * Set the limit of bytes that the decorator allows to be read from the
133 * @param int $limit Number of bytes to allow to be read from the stream.
134 * Use -1 for no limit.
137 public function setLimit($limit)
139 $this->limit = $limit;
146 if ($this->limit == -1) {
152 $remaining = ($this->offset + $this->limit) - $this->stream->tell();
155 // limit is not exceeded