Webmozart\Console\IO\OutputStream\BufferedOutputStream::write PHP Method

write() public method

public write ( $string )
    public function write($string)
    {
        if ($this->closed) {
            throw new IOException('Cannot read from a closed input.');
        }
        $this->buffer .= $string;
    }

Usage Example

 public function testClear()
 {
     $stream = new BufferedOutputStream();
     $stream->write('Lorem');
     $stream->clear();
     $stream->write('ipsum');
     $stream->close();
     $this->assertSame('ipsum', $stream->fetch());
 }