mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-08-06 10:21:54 +00:00
Update FileUtils.java
This commit is contained in:
@@ -449,14 +449,13 @@ public abstract class FileUtils {
|
||||
|
||||
public static void writeInputStreamToFile(File file, InputStream inputStream) {
|
||||
FileOutputStream fileOutputStream = null;
|
||||
OutputStreamWriter outputStreamWriter = null;
|
||||
try {
|
||||
fileOutputStream = openOutputStream(file, true);
|
||||
IOUtils.copy(inputStream, fileOutputStream);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
IOUtils.closeIO(outputStreamWriter, fileOutputStream);
|
||||
IOUtils.closeIO(fileOutputStream);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user