mirror of
https://gitee.com/dromara/sms4j.git
synced 2025-12-06 17:08:40 +08:00
!70 fix 修复ByteBuffer找不到flip()方法异常
Merge pull request !70 from Bleachtred/Feat_2.3_0706
This commit is contained in:
commit
b4d7d840a1
@ -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){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user