From: Tuukka Lehtonen Date: Fri, 14 Oct 2016 13:18:06 +0000 (+0300) Subject: InputStream returns -1 on EOF instead of throwing IOException X-Git-Tag: v1.25.0~68^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F24%2F124%2F2;p=simantics%2Fplatform.git InputStream returns -1 on EOF instead of throwing IOException ClusterSupport2.getValueStreamBig now returns -1 when EOF is reached. Previously it was invalidly throwing IOException (and before that very invalidly throwing IllegalStateException). refs #6741 Change-Id: I220e6bd26b94d92ae1db5a330ca3304035e7614e --- diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/internal/ClusterSupport2.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/internal/ClusterSupport2.java index b1b1e8365..20cd6f462 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/internal/ClusterSupport2.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/internal/ClusterSupport2.java @@ -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);