~ubuntu-branches/ubuntu/vivid/jzlib/vivid

« back to all changes in this revision

Viewing changes to com/jcraft/jzlib/InfBlocks.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2008-08-24 22:45:34 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080824224534-w0t34odkdtrfevta
Tags: 1.0.7-1
* New upstream release
* New maintainer (Closes: #491858)
* Use CDBS (Ant with debian/build.xml) for building
* Ship examples in libjzlib-java
* debian/libjzlib-java.dirs: Removed because dirs are created by dh_install
* debian/copyright: Made clear statements about license and upstreams
  authors (remove crufted debian/copyright.in and lintian override)
* debian/watch: monitoring of upstream release on jcraft.com
* debian/rules: create a get-orig-source using uscan and debian/watch
* debian/control:
  * Use better synopsis and long description (Thanks to Ben Finney)
  * Add Homepage and Vcs-* fields
  * Bumping debhelper compat level from 4 to 5 (see debian/compat)
  * Build-Depends on GCJ instead of Kaffe 

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
  int[] bb=new int[1]; // bit length tree depth 
82
82
  int[] tb=new int[1]; // bit length decoding tree 
83
83
 
84
 
  InfCodes codes;      // if CODES, current state 
 
84
  InfCodes codes=new InfCodes();      // if CODES, current state 
85
85
 
86
86
  int last;            // true if this block is the last block 
87
87
 
96
96
  Object checkfn;      // check function 
97
97
  long check;          // check on output 
98
98
 
 
99
  InfTree inftree=new InfTree();
 
100
 
99
101
  InfBlocks(ZStream z, Object checkfn, int w){
100
102
    hufts=new int[MANY*3];
101
103
    window=new byte[w];
108
110
  void reset(ZStream z, long[] c){
109
111
    if(c!=null) c[0]=check;
110
112
    if(mode==BTREE || mode==DTREE){
111
 
      blens=null;
112
113
    }
113
114
    if(mode==CODES){
114
115
      codes.free(z);
173
174
            int[][] tl=new int[1][];
174
175
            int[][] td=new int[1][];
175
176
 
176
 
            InfTree.inflate_trees_fixed(bl, bd, tl, td, z);
177
 
            codes = new InfCodes(bl[0], bd[0], tl[0], td[0], z);
 
177
            InfTree.inflate_trees_fixed(bl, bd, tl, td, z);
 
178
            codes.init(bl[0], bd[0], tl[0], 0, td[0], 0, z);
178
179
          }
179
180
 
180
181
          {b>>>=(3);k-=(3);}
302
303
            return inflate_flush(z,r);
303
304
          }
304
305
        t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
305
 
        blens=new int[t];
 
306
        if(blens==null || blens.length<t){
 
307
          blens=new int[t];
 
308
        }
 
309
        else{
 
310
          for(int i=0; i<t; i++){blens[i]=0;}
 
311
        }
306
312
 
307
313
        {b>>>=(14);k-=(14);}
308
314
 
336
342
        }
337
343
 
338
344
        bb[0] = 7;
339
 
        t = InfTree.inflate_trees_bits(blens, bb, tb, hufts, z);
 
345
        t = inftree.inflate_trees_bits(blens, bb, tb, hufts, z);
340
346
        if (t != Z_OK){
341
347
          r = t;
342
348
          if (r == Z_DATA_ERROR){
447
453
          int[] bd=new int[1];
448
454
          int[] tl=new int[1];
449
455
          int[] td=new int[1];
450
 
          InfCodes c;
451
 
 
452
456
          bl[0] = 9;         // must be <= 9 for lookahead assumptions
453
457
          bd[0] = 6;         // must be <= 9 for lookahead assumptions
 
458
 
454
459
          t = table;
455
 
          t = InfTree.inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
 
460
          t = inftree.inflate_trees_dynamic(257 + (t & 0x1f), 
 
461
                                            1 + ((t >> 5) & 0x1f),
456
462
                                            blens, bl, bd, tl, td, hufts, z);
 
463
 
457
464
          if (t != Z_OK){
458
465
            if (t == Z_DATA_ERROR){
459
466
              blens=null;
466
473
            write=q;
467
474
            return inflate_flush(z,r);
468
475
          }
469
 
 
470
 
          codes = new InfCodes(bl[0], bd[0], hufts, tl[0], hufts, td[0], z);
 
476
          codes.init(bl[0], bd[0], hufts, tl[0], hufts, td[0], z);
471
477
        }
472
 
        blens=null;
473
478
        mode = CODES;
474
479
      case CODES:
475
480
        bitb=b; bitk=k;