/** * 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()); }
public function testGetResourceReturnsThePHPResource() { $handle = fopen('php://temp', 'r+'); $stream = new Stream($handle); $this->assertEquals($handle, $stream->getResource()); }