From ca627e9baa4017fc7c3ffe696728a61f8475b214 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 17 Oct 2023 10:30:58 -0500 Subject: [PATCH] Use InputStream#readAllBytes --- .../java/me/wiefferink/areashop/ASLanguageManager.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/AreaShop/src/main/java/me/wiefferink/areashop/ASLanguageManager.java b/AreaShop/src/main/java/me/wiefferink/areashop/ASLanguageManager.java index 3f191914..85a8d5fa 100644 --- a/AreaShop/src/main/java/me/wiefferink/areashop/ASLanguageManager.java +++ b/AreaShop/src/main/java/me/wiefferink/areashop/ASLanguageManager.java @@ -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()); }