fix(TDI-46615): resumeutil compiled jdk11 cannot run in jdk 8 (#4548)

* fix(TDI-46615): resumeutil compiled jdk11 cannot run in jdk 8

* fix clear() method
This commit is contained in:
pyzhou
2021-08-27 15:45:47 +08:00
committed by GitHub
parent 823b72bcd9
commit 00c0652cbb

View File

@@ -16,10 +16,10 @@ import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.RandomAccessFile;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -555,13 +555,13 @@ public class ResumeUtil {
*/
public void flush() {
try {
buf.flip();
((Buffer) buf).flip();
channel.position(channel.size());
while(buf.hasRemaining()) {
channel.write(buf);
}
channel.force(true);
buf.clear();
((Buffer) buf).clear();
} catch (IOException e) {
e.printStackTrace();
}