public void toFile(File file, boolean compress) throws IOException
	{
		byte[] data = getData();
		if(file.exists() && file.isFile())
		{
			if(!file.delete()) throw new IOException("Unable to delete existing file!");
		}
		//if(!file.getParentFile().mkdirs()) throw new IOException("Unable to make directories to file!");
		if(!file.exists() || !file.isFile())
		{
			if(!file.createNewFile()) throw new IOException("Unable to create new file!");
		}
		if(compress)
		{
			GZIPOutputStream out = new GZIPOutputStream(new FileOutputStream(file));
			out.write(data);
			out.flush();
			out.close();
		}
		else
		{
			FileOutputStream out = new FileOutputStream(file);
			out.write(data);
			out.flush();
			out.close();
		}
	}