summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/com/jogamp/common/util/IOUtil.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/java/com/jogamp/common/util/IOUtil.java b/src/java/com/jogamp/common/util/IOUtil.java
index c3d3345..c07ca63 100644
--- a/src/java/com/jogamp/common/util/IOUtil.java
+++ b/src/java/com/jogamp/common/util/IOUtil.java
@@ -243,12 +243,12 @@ public class IOUtil {
}
numRead = stream.read(chunk, 0, chunk2Read);
- if (numRead >= 0) {
+ if (numRead > 0) {
data.put(chunk, 0, numRead);
}
avail = stream.available();
chunk2Read = Math.min(machine.pageSizeInBytes(), avail);
- } while ( numRead > -1 ); // EOS: -1 == numRead
+ } while ( numRead > 0 ); // EOS: -1 == numRead, EOF maybe reached earlier w/ 0 == numRead
data.flip();
return data;