diff --git a/hadoop-tools/hadoop-archives/src/test/java/org/apache/hadoop/tools/TestHadoopArchives.java b/hadoop-tools/hadoop-archives/src/test/java/org/apache/hadoop/tools/TestHadoopArchives.java index 165c51559ed..e9ecf0489b6 100644 --- a/hadoop-tools/hadoop-archives/src/test/java/org/apache/hadoop/tools/TestHadoopArchives.java +++ b/hadoop-tools/hadoop-archives/src/test/java/org/apache/hadoop/tools/TestHadoopArchives.java @@ -444,7 +444,7 @@ public class TestHadoopArchives { int read; while (true) { read = fsdis.read(buffer, readIntoBuffer, buffer.length - readIntoBuffer); - if (read < 0) { + if (read <= 0) { // end of stream: if (readIntoBuffer > 0) { baos.write(buffer, 0, readIntoBuffer);