Move force() after multiple writes, not at every steps
This commit is contained in:
parent
65876fa7fb
commit
877383de3a
@ -212,8 +212,8 @@ public abstract class AbstractMemoryHttpData extends AbstractHttpData {
|
|||||||
int written = 0;
|
int written = 0;
|
||||||
while (written < length) {
|
while (written < length) {
|
||||||
written += fileChannel.write(byteBuffer);
|
written += fileChannel.write(byteBuffer);
|
||||||
fileChannel.force(false);
|
|
||||||
}
|
}
|
||||||
|
fileChannel.force(false);
|
||||||
fileChannel.close();
|
fileChannel.close();
|
||||||
isRenamed = true;
|
isRenamed = true;
|
||||||
return written == length;
|
return written == length;
|
||||||
|
Loading…
Reference in New Issue
Block a user