Added setContent method

This commit is contained in:
Ziver Koc 2015-11-20 16:09:07 +01:00
parent 66bebc6f52
commit 4a027fab5f

View file

@ -147,6 +147,17 @@ public class FileUtil {
return data;
}
/**
* Replaces the contents of a file with the specified data.
*
* @param file the file to write the data to
* @param data the data to write to the file
*/
public static void setContent(File file, byte[] data) throws IOException{
OutputStream out = new FileOutputStream(file);
out.write(data);
out.close();
}
/**
* Cache for the search functions