{
File tImageFile = new File(aImageFileName);
if(tImageFile.exists() && !aOverWriteExistingFile) //look if image exists
{
throw new ProgrammerException( "ImageCreator::createImage: aImageFile " +
aImageFileName + " still exists." );
}
try
{
FileOutputStream aImageOutput= new FileOutputStream(tImageFile);
//open fileOutputStream
aImageOutput.write( createImage(aNumber).getBytes());
//write image into stream
aImageOutput.close(); //close stream
}
catch(IOException aIOE) //something went wrong
{
throw new ProgrammerException( "ImageCreator::createImage: IOException " +
aIOE.getMessage() );
}
} //end saveImage