diff options
author | Keiron Liddle <keiron@apache.org> | 2002-08-02 06:50:08 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2002-08-02 06:50:08 +0000 |
commit | 78fec1593592cc7bfc0078ebaa3e3a0fda780cb6 (patch) | |
tree | a20e7e5e1335db71de76c4f3f39ec46ec3439915 /src/org/apache/fop | |
parent | 5d1208bcd158014ddc52f76ee11ab1e71499e342 (diff) | |
download | xmlgraphics-fop-78fec1593592cc7bfc0078ebaa3e3a0fda780cb6.tar.gz xmlgraphics-fop-78fec1593592cc7bfc0078ebaa3e3a0fda780cb6.zip |
Simplified ASCII85Filter computation, thereby hopefully
working around JVM bugs
from Branch
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195049 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop')
-rw-r--r-- | src/org/apache/fop/pdf/ASCII85Filter.java | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/org/apache/fop/pdf/ASCII85Filter.java b/src/org/apache/fop/pdf/ASCII85Filter.java index 84e03f0eb..d08e835bb 100644 --- a/src/org/apache/fop/pdf/ASCII85Filter.java +++ b/src/org/apache/fop/pdf/ASCII85Filter.java @@ -17,11 +17,9 @@ public class ASCII85Filter extends PDFFilter { private static final String ASCII85_EOD = "~>"; private static final long base85_4 = 85; - private static final long base85_3 = base85_4 * base85_4; - private static final long base85_2 = base85_3 * base85_4; - private static final long base85_1 = base85_2 * base85_4; - - + //private static final long base85_3 = base85_4 * base85_4; + //private static final long base85_2 = base85_3 * base85_4; + //private static final long base85_1 = base85_2 * base85_4; public String getName() { return "/ASCII85Decode"; @@ -124,6 +122,7 @@ public class ASCII85Filter extends PDFFilter { }; return result; } else { + /* byte c1 = (byte)((word / base85_1) & 0xFF); byte c2 = (byte)(((word - (c1 * base85_1)) / base85_2) & 0xFF); byte c3 = @@ -141,6 +140,22 @@ public class ASCII85Filter extends PDFFilter { (byte)(c3 + ASCII85_START), (byte)(c4 + ASCII85_START), (byte)(c5 + ASCII85_START) }; + */ + + byte c5 = (byte)((word % base85_4) + ASCII85_START); + word = word / base85_4; + byte c4 = (byte)((word % base85_4) + ASCII85_START); + word = word / base85_4; + byte c3 = (byte)((word % base85_4) + ASCII85_START); + word = word / base85_4; + byte c2 = (byte)((word % base85_4) + ASCII85_START); + word = word / base85_4; + byte c1 = (byte)((word % base85_4) + ASCII85_START); + + byte[] ret = { + c1 , c2, c3, c4, c5 + }; + for (int i = 0; i < ret.length; i++) { if (ret[i] < 33 || ret[i] > 117) { System.out.println("illegal char value " |