(cherry picked from commit b970446b2c59f8897bb2c3a562fa192ed3452db5) (cherry picked from commit 3b279fe4260d99f95787ea5cce428f9ef337a3cb)
@@ -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);