Lines Matching refs:stream
8 * read stream.
21 * We will treat the buffer object as the body of the stream
23 * @param StreamInterface $stream Stream to cache
27 StreamInterface $stream,
30 $this->remoteStream = $stream;
31 $this->stream = $target ?: new Stream(fopen('php://temp', 'r+'));
36 return max($this->stream->getSize(), $this->remoteStream->getSize());
42 * past the total size of the buffer stream
54 // You cannot skip ahead past where you've read from the remote stream
55 if ($byte > $this->stream->getSize()) {
59 sprintf('Cannot seek to byte %d when the buffered stream only'
60 . ' contains %d bytes', $byte, $this->stream->getSize())
64 return $this->stream->seek($byte);
70 $data = $this->stream->read($length);
73 // More data was requested so read from the remote stream
76 // been filled from the remote stream, then we must skip bytes on
77 // the remote stream to emulate overwriting bytes from that
78 // position. This mimics the behavior of other PHP stream wrappers.
90 $this->stream->write($remoteData);
98 // When appending to the end of the currently read stream, you'll want
99 // to skip bytes from being read from the remote stream to emulate
100 // other stream wrappers. Basically replacing bytes of data of a fixed
107 return $this->stream->write($string);
112 return $this->stream->eof() && $this->remoteStream->eof();
116 * Close both the remote stream and buffer stream
120 $this->remoteStream->close() && $this->stream->close();