Skip to content

Commit

Permalink
flush() in Streams.transferTo, re #9
Browse files Browse the repository at this point in the history
  • Loading branch information
safris committed Feb 27, 2024
1 parent ae8fbe4 commit eb31a1f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/libj/io/Streams.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit eb31a1f

Please sign in to comment.