public function write($string) { if ($this->closed) { throw new IOException('Cannot read from a closed input.'); } $this->buffer .= $string; }
public function testClear() { $stream = new BufferedOutputStream(); $stream->write('Lorem'); $stream->clear(); $stream->write('ipsum'); $stream->close(); $this->assertSame('ipsum', $stream->fetch()); }