public function flush()
    {
        if ($this->isOpen() === true) {
            $this->setBinary('');
            $this->rewind();
        } else {
            $msg = "Cannot flush a closed MemoryStream.";
            throw new MemoryStreamException($msg, $this, MemoryStreamException::NOT_OPEN);
        }
    }
public function flush()
    {
        if ($this->isOpen() === true) {
            $this->setBinary('');
            $this->rewind();
        } else {
            $msg = "Cannot flush a closed MemoryStream.";
            throw new MemoryStreamException($msg, $this, MemoryStreamException::NOT_OPEN);
        }
    }
public function flush ( ) { if ( $ this -> isOpen ( ) === true ) { $ this -> setBinary ( '' ) ; $ this -> rewind ( ) ; } else { $ msg = "Cannot flush a closed MemoryStream." ; throw new MemoryStreamException ( $ msg , $ this , MemoryStreamException :: NOT_OPEN ) ; } }
Flush the whole stream.

@throws \qtism\common\storage\MemoryStreamException If the binary stream is closed.
Flush the whole stream .