]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Merge "InputStream returns -1 on EOF instead of throwing IOException"
authorJani Simomaa <jani.simomaa@vtt.fi>
Mon, 17 Oct 2016 07:41:11 +0000 (10:41 +0300)
committerGerrit Code Review <gerrit2@www.simantics.org>
Mon, 17 Oct 2016 07:41:11 +0000 (10:41 +0300)
bundles/org.simantics.acorn/src/org/simantics/acorn/internal/ClusterSupport2.java

index b1b1e8365f22bd8da329284a344639add33093cd..20cd6f462da5865109b4dda0ee25278b1f4633e6 100644 (file)
@@ -258,8 +258,7 @@ public class ClusterSupport2 implements ClusterSupport, IClusterTable {
                @Override
                public int read() throws IOException {
 
-                       if(left <= 0)
-                           throw new IOException("left <= 0 for " + _s);
+                       if(left <= 0) return -1;
 
                        if(offset == _s.bytes.length) {
                                short slen = (short)Math.min(left, IMAX);