Skip to content

Commit

Permalink
[tests] Convert java io fileoutput stream to nio files output stream
Browse files Browse the repository at this point in the history
  • Loading branch information
hazendaz committed Jan 28, 2025
1 parent 3b73a27 commit 8164a6e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Calendar;
import java.util.HashMap;
Expand Down Expand Up @@ -63,7 +63,7 @@ static void unzip(URL url, Path unzipDestination) throws IOException {
unzippedFile.toFile().mkdirs();
} else {
unzippedFile.toFile().getParentFile().mkdirs();
try (OutputStream out = new BufferedOutputStream(new FileOutputStream(unzippedFile.toFile()), 2048)) {
try (OutputStream out = new BufferedOutputStream(Files.newOutputStream(unzippedFile), 2048)) {
int len;
while ((len = zipInputStream.read(buffer)) != -1) {
out.write(buffer, 0, len);
Expand Down

0 comments on commit 8164a6e

Please sign in to comment.