keiron      2002/08/01 23:50:08

  Modified:    src/org/apache/fop/pdf ASCII85Filter.java
  Log:
  Simplified ASCII85Filter computation, thereby hopefully
  working around JVM bugs
  from Branch
  
  Revision  Changes    Path
  1.5       +21 -6     xml-fop/src/org/apache/fop/pdf/ASCII85Filter.java
  
  Index: ASCII85Filter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/pdf/ASCII85Filter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ASCII85Filter.java        27 May 2002 10:59:07 -0000      1.4
  +++ ASCII85Filter.java        2 Aug 2002 06:50:08 -0000       1.5
  @@ -17,11 +17,9 @@
       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 @@
               };
               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 @@
                   (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 "
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to