@Override public void decode(final BufferedInputStream bis,final BufferedOutputStream streamCache,final String cacheName,final Map<String,String> cachedObjects){
  this.bis=bis;
  this.streamCache=streamCache;
  this.cachedObjects=cachedObjects;
  long value;
  int nextValue;
  try {
    boolean ignoreLastItem=false;
    while (bis.available() > 0) {
      value=0;
      nextValue=read(bis);
      if (nextValue == 122) {
        for (int i3=0; i3 < 4; i3++) {
          streamCache.write(0);
        }
      }
 else       if ((bis.available() >= 4) && (nextValue > 32) && (nextValue < 118)) {
        value+=((nextValue - 33) * base_85_indices[0]);
        for (int ii=1; ii < 5; ii++) {
          nextValue=read(bis);
          if (nextValue == -1) {
            nextValue=0;
          }
          if (nextValue == -1) {
            ignoreLastItem=true;
          }
          if (((nextValue > 32) && (nextValue < 118)) || (nextValue == 126)) {
            value+=((nextValue - 33) * base_85_indices[ii]);
          }
        }
        if (!ignoreLastItem) {
          for (int i3=0; i3 < 4; i3++) {
            final byte b=(byte)((value / hex_indices[i3]) & 255);
            streamCache.write(b);
          }
        }
      }
    }
  }
 catch (  final Exception e) {
    LogWriter.writeLog("Exception " + e + " accessing Ascii85Decode filter ");
  }
}

@ Override public void decode ( final BufferedInputStream bis , final BufferedOutputStream streamCache , final String cacheName , final Map < String , String > cachedObjects ) { this . bis = bis ; this . streamCache = streamCache ; this . cachedObjects = cachedObjects ; long value ; int nextValue ; try { boolean ignoreLastItem = false ; while ( bis . available ( ) > 0 ) { value = 0 ; nextValue = read ( bis ) ; if ( nextValue == 122 ) { for ( int i3 = 0 ; i3 < 4 ; i3 ++ ) { streamCache . write ( 0 ) ; } } else if ( ( bis . available ( ) >= 4 ) && ( nextValue > 32 ) && ( nextValue < 118 ) ) { value += ( ( nextValue - 33 ) * base_85_indices [ 0 ] ) ; for ( int ii = 1 ; ii < 5 ; ii ++ ) { nextValue = read ( bis ) ; if ( nextValue == - 1 ) { nextValue = 0 ; } if ( nextValue == - 1 ) { ignoreLastItem = true ; } if ( ( ( nextValue > 32 ) && ( nextValue < 118 ) ) || ( nextValue == 126 ) ) { value += ( ( nextValue - 33 ) * base_85_indices [ ii ] ) ; } } if ( ! ignoreLastItem ) { for ( int i3 = 0 ; i3 < 4 ; i3 ++ ) { final byte b = ( byte ) ( ( value / hex_indices [ i3 ] ) & 255 ) ; streamCache . write ( b ) ; } } } } } catch ( final Exception e ) { LogWriter . writeLog ( "Exception " + e + " accessing Ascii85Decode filter " ) ; } }
ascii85decode using our own implementation
