Added setContent method
This commit is contained in:
parent
66bebc6f52
commit
4a027fab5f
1 changed files with 11 additions and 0 deletions
|
|
@ -147,6 +147,17 @@ public class FileUtil {
|
||||||
return data;
|
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
|
* Cache for the search functions
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue