Esempio n. 1
0
 /**
  * Read the content of this stream and write it to another stream, by chunks of $bufferSize
  *
  * @param Stream $stream The destination stream to write to
  *
  * @return int Number of piped bytes
  */
 public function pipe(Stream $stream)
 {
     return stream_copy_to_stream($this->getResource(), $stream->getResource());
 }
Esempio n. 2
0
 public function testGetResourceReturnsThePHPResource()
 {
     $handle = fopen('php://temp', 'r+');
     $stream = new Stream($handle);
     $this->assertEquals($handle, $stream->getResource());
 }