public function write($string) { $this->assertAttached(); $result = $this->stream->write($string); if ($result === false) { throw new \RuntimeException('An error occurred during the write operation.'); } return $result; }
public function appendTo(Stream $stream, $maxBufferSize = 1048576) { $this->seek(0); $streamSize = $this->getSize(); if ($streamSize < $maxBufferSize) { $content = $this->read($streamSize); if ($content === false) { return false; } $stream->write($content); return true; } while (!$this->isEof()) { $content = $this->read($maxBufferSize); if ($content === false) { return false; } $stream->write($content); } return true; }
public function appendTo(Stream $stream, $maxBufferSize = 1048576) { $this->assertOpen(); $stream->write($this->content); return true; }