!70 fix 修复ByteBuffer找不到flip()方法异常

Merge pull request !70 from Bleachtred/Feat_2.3_0706
This commit is contained in:
风如歌 2023-07-06 10:27:54 +00:00 committed by Gitee
commit b4d7d840a1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -10,6 +10,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.channels.*;
import java.util.Map;
@ -40,9 +41,9 @@ public class ZipUtils extends ZipUtil {
try (ReadableByteChannel readableByteChannel = pipe.source()) {
ByteBuffer buffer = ByteBuffer.allocate(TEMP_SIZE);
while (readableByteChannel.read(buffer) >= 0) {
buffer.flip();
((Buffer)buffer).flip();
out.write(buffer);
buffer.clear();
((Buffer)buffer).clear();
}
}
}catch (Exception e){