Skip to content

Commit ce2ecef

Browse files
authored
Merge pull request #12472 from jsgrah-spring/master
close #12095
2 parents 193c7f8 + 535abc8 commit ce2ecef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core-java-modules/core-java-9/src/test/java/com/baeldung/java9/inputstream/outputstream/InputStreamToOutputStreamUnitTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class InputStreamToOutputStreamUnitTest {
2020
void copy(InputStream source, OutputStream target) throws IOException {
2121
byte[] buf = new byte[8192];
2222
int length;
23-
while ((length = source.read(buf)) > 0) {
23+
while ((length = source.read(buf)) != -1) {
2424
target.write(buf, 0, length);
2525
}
2626
}

0 commit comments

Comments
 (0)