From 85baec7a2bdbfb4901e2ccb3f7b63980fdac6fe6 Mon Sep 17 00:00:00 2001 From: Valerio Pilo Date: Mon, 22 Apr 2024 23:30:12 +0200 Subject: [PATCH] Fix android strict mode warning (#1623) --- .../net/bytebuddy/android/AndroidClassLoadingStrategy.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/byte-buddy-android/src/main/java/net/bytebuddy/android/AndroidClassLoadingStrategy.java b/byte-buddy-android/src/main/java/net/bytebuddy/android/AndroidClassLoadingStrategy.java index dd1de5aa53..7fec41a2ac 100644 --- a/byte-buddy-android/src/main/java/net/bytebuddy/android/AndroidClassLoadingStrategy.java +++ b/byte-buddy-android/src/main/java/net/bytebuddy/android/AndroidClassLoadingStrategy.java @@ -33,6 +33,7 @@ import net.bytebuddy.utility.nullability.AlwaysNull; import net.bytebuddy.utility.nullability.MaybeNull; +import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -167,7 +168,7 @@ public Map> load(@MaybeNull ClassLoader classLoader, M if (!jar.createNewFile()) { throw new IllegalStateException("Cannot create " + jar); } - JarOutputStream outputStream = new JarOutputStream(new FileOutputStream(jar)); + JarOutputStream outputStream = new JarOutputStream(new BufferedOutputStream(new FileOutputStream(jar))); try { outputStream.putNextEntry(new JarEntry(DEX_CLASS_FILE)); conversion.drainTo(outputStream);