Add @Cleanup for Copied to prevent accident exception make stream keep open

Former-commit-id: 8f24306167518895459369a11171163f5004cdc5
This commit is contained in:
Ghost_chu committed 2020-07-29 19:56:43 +08:00
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;