private function writeFile($path)
{
$handle = fopen($path, 'wb+');
if (false === $handle) {
throw new RuntimeException('Unable to write to designated path');
}
$this->stream->rewind();
while (!$this->stream->eof()) {
fwrite($handle, $this->stream->read(4096));
}
fclose($handle);
}