mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-17 14:19:41 -05:00
Add @Cleanup for Copied to prevent accident exception make stream keep open
Former-commit-id: 8f24306167518895459369a11171163f5004cdc5
This commit is contained in:
1 parent
e16368d9a1
commit
2e105e41f7
1 file changed
+2
-1
@@ -19,6 +19,7 @@
|
||||
|
||||
package org.maxgamer.quickshop.util;
|
||||
|
||||
import lombok.Cleanup;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
@@ -38,7 +39,7 @@ public class Copied implements Consumer<InputStream> {
|
||||
|
||||
@Override
|
||||
public void accept(@NotNull InputStream inputStream) {
|
||||
try (OutputStream out = new FileOutputStream(file)) {
|
||||
try (@Cleanup OutputStream out = new FileOutputStream(file)) {
|
||||
final byte[] buf = new byte[1024];
|
||||
int len;
|
||||
|
||||
|
||||
Reference in new issue
Block a user