Skip to content

Commit

Permalink
Merge pull request eugenp#5621 from holgerl/patch-1
Browse files Browse the repository at this point in the history
FileOutputStream is never closed
  • Loading branch information
lor6 authored Dec 15, 2018
2 parents b6e0928 + 770b28f commit 06d925e
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public static void downloadWithJavaNIO(String fileURL, String localFilename) thr
FileOutputStream fileOutputStream = new FileOutputStream(localFilename); FileChannel fileChannel = fileOutputStream.getChannel()) {

fileChannel.transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
fileOutputStream.close();
}
}

Expand Down

0 comments on commit 06d925e

Please sign in to comment.