Lines Matching refs:stream
7 * Decorator used to return only a subset of a stream
20 * @param StreamInterface $stream Stream to wrap
22 * from the stream. Pass -1 for no limit.
27 StreamInterface $stream,
31 $this->stream = $stream;
38 // Always return true if the underlying stream is EOF
39 if ($this->stream->eof()) {
43 // No limit and the underlying stream is not at EOF
48 $tell = $this->stream->tell();
62 if (null === ($length = $this->stream->getSize())) {
72 * Allow for a bounded seek on the read limited stream
89 return $this->stream->seek($offset);
98 return $this->stream->tell() - $this->offset;
111 $current = $this->stream->tell();
114 // If the stream cannot seek to the offset position, then read to it
115 if (!$this->stream->seek($offset)) {
119 $this->stream->read($offset - $current);
131 * stream.
133 * @param int $limit Number of bytes to allow to be read from the stream.
147 return $this->stream->read($length);
152 $remaining = ($this->offset + $this->limit) - $this->stream->tell();
156 return $this->stream->read(min($remaining, $length));