修复IoUtil.copyByNIO方法写出时没有flush的问题

This commit is contained in:
Looly
2022-10-27 18:51:00 +08:00
parent 2bafc6c8a8
commit 7b23328d3f
2 changed files with 5 additions and 2 deletions

View File

@@ -70,7 +70,9 @@ public class NioUtil {
* @since 5.7.8
*/
public static long copyByNIO(InputStream in, OutputStream out, int bufferSize, long count, StreamProgress streamProgress) throws IORuntimeException {
return copy(Channels.newChannel(in), Channels.newChannel(out), bufferSize, count, streamProgress);
final long copySize = copy(Channels.newChannel(in), Channels.newChannel(out), bufferSize, count, streamProgress);
IoUtil.flush(out);
return copySize;
}
/**