|
|
@ -1,5 +1,6 @@
|
|
|
|
package ${basePackage}.frame.utils;
|
|
|
|
package ${basePackage}.frame.utils;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.BufferedOutputStream;
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
@ -82,6 +83,33 @@ public class FileUtil {
|
|
|
|
return var5;
|
|
|
|
return var5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void writeBytesToFile(byte[] buffer, final File file) {
|
|
|
|
|
|
|
|
OutputStream output = null;
|
|
|
|
|
|
|
|
BufferedOutputStream bufferedOutput = null;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
output = new FileOutputStream(file);
|
|
|
|
|
|
|
|
bufferedOutput = new BufferedOutputStream(output);
|
|
|
|
|
|
|
|
bufferedOutput.write(buffer);
|
|
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
if (null != bufferedOutput) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
bufferedOutput.close();
|
|
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (null != output) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
output.close();
|
|
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean writeStringToFile(String data, File file, boolean isNewLine, boolean isAppend) {
|
|
|
|
public static boolean writeStringToFile(String data, File file, boolean isNewLine, boolean isAppend) {
|
|
|
|
PrintWriter printWriter = null;
|
|
|
|
PrintWriter printWriter = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|