diff options
author | Sven Gothel <[email protected]> | 2013-02-01 02:31:29 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-02-01 02:31:29 +0100 |
commit | 1118cb7182611d0a77764a3c781a1148849b3022 (patch) | |
tree | a53a9a5ec2bf648e89083a64fa62e19d253d8e03 | |
parent | ec7f7a3c809bb9e3beb84ce90e2fcbd8b7f4b7ee (diff) |
IOUtil.copyStream2ByteBuffer: Turns out on Android, no -1 (EOS) is returned - relax loop-condition (hope thats ok)
-rw-r--r-- | src/java/com/jogamp/common/util/IOUtil.java | 4 |
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; |