Move force() after multiple writes, not at every steps

This commit is contained in:
Frédéric Brégier 2012-04-30 12:30:08 +03:00
parent 65876fa7fb
commit 877383de3a

View File

@ -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;