Lines Matching refs:stream
75 * @param StreamInterface $stream Stream to read
83 public static function copyToString(StreamInterface $stream, $maxLen = -1) argument
88 while (!$stream->eof()) {
89 $buf = $stream->read(1048576);
100 while (!$stream->eof() && $len < $maxLen) {
101 $buf = $stream->read($maxLen - $len);
119 * @param StreamInterface $stream Stream to calculate the hash for
127 public static function hash(StreamInterface $stream, $algo, $rawOutput = false) argument
129 $pos = $stream->tell();
132 $stream->rewind();
136 while (!$stream->eof()) {
137 hash_update($ctx, $stream->read(1048576));
141 $stream->seek($pos);
242 * @param StreamInterface $stream Stream to read from
247 public static function readLine(StreamInterface $stream, $maxLength = null) argument
252 while (!$stream->eof()) {
254 if (null == ($byte = $stream->read(1))) {
306 $stream = self::tryFopen('php://temp', 'r+');
308 fwrite($stream, $resource);
309 fseek($stream, 0);
311 return new Stream($stream, $options);
322 $stream = self::tryFopen('php://temp', 'w+');
323 fwrite($stream, stream_get_contents($resource));
324 fseek($stream, 0);
325 $resource = $stream;