protected function write($string, $format = true)
    {
        if ($format) {
            $string .= $this->delimiter;
        }

        $string .= "\n";

        if (fwrite($this->file, $string, strlen($string)) === false) {
            throw new Exception('Unable to write '.strlen($string).' bytes to the dumpfile.');
        }
    }