From eb31a1f5d2ee0d960ff708cdb8b780e7acbb77c7 Mon Sep 17 00:00:00 2001 From: Seva Safris Date: Tue, 27 Feb 2024 11:10:27 +0700 Subject: [PATCH] flush() in Streams.transferTo, re #9 --- src/main/java/org/libj/io/Streams.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/libj/io/Streams.java b/src/main/java/org/libj/io/Streams.java index 8d3be49..9bc6df5 100644 --- a/src/main/java/org/libj/io/Streams.java +++ b/src/main/java/org/libj/io/Streams.java @@ -795,6 +795,7 @@ public static long transferTo(final InputStream src, final OutputStream snk) thr for (int read; (read = src.read(buffer, 0, DEFAULT_SOCKET_BUFFER_SIZE)) >= 0; total += read) // [X] snk.write(buffer, 0, read); + snk.flush(); return total; }