From 1118cb7182611d0a77764a3c781a1148849b3022 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 1 Feb 2013 02:31:29 +0100 Subject: IOUtil.copyStream2ByteBuffer: Turns out on Android, no -1 (EOS) is returned - relax loop-condition (hope thats ok) --- src/java/com/jogamp/common/util/IOUtil.java | 4 ++-- 1 file 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; -- cgit v1.2.3