Skip to content

Commit

Permalink
Use InputStream#readAllBytes
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinDart authored and md5sha256 committed Dec 2, 2023
1 parent 8198f5f commit ca627e9
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,8 @@ private void saveDefaults() {
InputStream input = jar.getInputStream(entry);
OutputStream output = new FileOutputStream(targetFile)
) {
int read;
byte[] bytes = new byte[1024];
while((read = input.read(bytes)) != -1) {
output.write(bytes, 0, read);
}
byte[] bytes = input.readAllBytes();
output.write(bytes);
} catch(IOException e) {
Log.warn("Something went wrong saving a default language file: " + targetFile.getAbsolutePath());
}
Expand Down

0 comments on commit ca627e9

Please sign in to comment.