Skip to content

Commit

Permalink
TempFile + simple
Browse files Browse the repository at this point in the history
  • Loading branch information
phlppchrtn committed Jun 4, 2024
1 parent cfb1634 commit ba7835c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ default byte[] getBytes() {
while ((nRead = inputStream.read(data, 0, data.length)) != -1) {
buffer.write(data, 0, nRead);
}
buffer.flush();
return buffer.toByteArray();
} catch (final IOException e) {
throw WrappedException.wrap(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static File of(final String prefix, final String suffix) throws IOExcepti
}

private static File of(final String prefix, final String suffix, final Path path) throws IOException {
final File file = new File(Files.createTempFile(path, prefix, suffix).toAbsolutePath().toString());
final File file = Files.createTempFile(path, prefix, suffix).toFile();
file.deleteOnExit();
return file;
}
Expand Down

0 comments on commit ba7835c

Please sign in to comment.