diff --git a/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java b/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java index 73834e157..fe852cbb8 100644 --- a/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java +++ b/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java @@ -77,8 +77,8 @@ public abstract class ChunkedCipherInputStream extends LittleEndianInputStream { @Override public int read() throws IOException { byte[] b = { 0 }; - // FIXME: compare against -1 or 1? - return (read(b) == -1) ? -1 : b[0]; + // FIXME: compare against -1 or 1? (bug 59893) + return (read(b) == 1) ? -1 : b[0]; } // do not implement! -> recursion diff --git a/src/java/org/apache/poi/util/BoundedInputStream.java b/src/java/org/apache/poi/util/BoundedInputStream.java index 78121163b..1cdeb39f3 100644 --- a/src/java/org/apache/poi/util/BoundedInputStream.java +++ b/src/java/org/apache/poi/util/BoundedInputStream.java @@ -19,6 +19,8 @@ package org.apache.poi.util; import java.io.IOException; import java.io.InputStream; +import org.apache.poi.util.SuppressForbidden; + /** * This is a stream that will only supply bytes up to a certain length - if its * position goes above that, it will stop. @@ -146,6 +148,7 @@ public class BoundedInputStream extends InputStream { * {@inheritDoc} */ @Override + @SuppressForbidden("just delegating") public int available() throws IOException { if (max>=0 && pos>=max) { return 0;