home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / java / util / zip / Inflater.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  2.0 KB  |  156 lines

  1. package java.util.zip;
  2.  
  3. import java.security.AccessController;
  4. import sun.security.action.LoadLibraryAction;
  5.  
  6. public class Inflater {
  7.    private long strm;
  8.    private byte[] buf;
  9.    private int off;
  10.    private int len;
  11.    private boolean finished;
  12.    private boolean needDict;
  13.  
  14.    public Inflater(boolean var1) {
  15.       this.buf = new byte[0];
  16.       this.strm = init(var1);
  17.    }
  18.  
  19.    public Inflater() {
  20.       this(false);
  21.    }
  22.  
  23.    public synchronized void setInput(byte[] var1, int var2, int var3) {
  24.       if (var1 == null) {
  25.          throw new NullPointerException();
  26.       } else if (var2 >= 0 && var3 >= 0 && var2 + var3 <= var1.length) {
  27.          this.buf = var1;
  28.          this.off = var2;
  29.          this.len = var3;
  30.       } else {
  31.          throw new ArrayIndexOutOfBoundsException();
  32.       }
  33.    }
  34.  
  35.    public void setInput(byte[] var1) {
  36.       this.setInput(var1, 0, var1.length);
  37.    }
  38.  
  39.    public synchronized void setDictionary(byte[] var1, int var2, int var3) {
  40.       if (this.strm != 0L && var1 != null) {
  41.          if (var2 >= 0 && var3 >= 0 && var2 + var3 <= var1.length) {
  42.             setDictionary(this.strm, var1, var2, var3);
  43.             this.needDict = false;
  44.          } else {
  45.             throw new ArrayIndexOutOfBoundsException();
  46.          }
  47.       } else {
  48.          throw new NullPointerException();
  49.       }
  50.    }
  51.  
  52.    public void setDictionary(byte[] var1) {
  53.       this.setDictionary(var1, 0, var1.length);
  54.    }
  55.  
  56.    public synchronized int getRemaining() {
  57.       return this.len;
  58.    }
  59.  
  60.    public synchronized boolean needsInput() {
  61.       return this.len <= 0;
  62.    }
  63.  
  64.    public synchronized boolean needsDictionary() {
  65.       return this.needDict;
  66.    }
  67.  
  68.    public synchronized boolean finished() {
  69.       return this.finished;
  70.    }
  71.  
  72.    public synchronized int inflate(byte[] var1, int var2, int var3) throws DataFormatException {
  73.       if (var1 == null) {
  74.          throw new NullPointerException();
  75.       } else if (var2 >= 0 && var3 >= 0 && var2 + var3 <= var1.length) {
  76.          return this.inflateBytes(var1, var2, var3);
  77.       } else {
  78.          throw new ArrayIndexOutOfBoundsException();
  79.       }
  80.    }
  81.  
  82.    public int inflate(byte[] var1) throws DataFormatException {
  83.       return this.inflate(var1, 0, var1.length);
  84.    }
  85.  
  86.    public synchronized int getAdler() {
  87.       if (this.strm == 0L) {
  88.          throw new NullPointerException();
  89.       } else {
  90.          return getAdler(this.strm);
  91.       }
  92.    }
  93.  
  94.    public synchronized int getTotalIn() {
  95.       if (this.strm == 0L) {
  96.          throw new NullPointerException();
  97.       } else {
  98.          return getTotalIn(this.strm);
  99.       }
  100.    }
  101.  
  102.    public synchronized int getTotalOut() {
  103.       if (this.strm == 0L) {
  104.          throw new NullPointerException();
  105.       } else {
  106.          return getTotalOut(this.strm);
  107.       }
  108.    }
  109.  
  110.    public synchronized void reset() {
  111.       if (this.strm == 0L) {
  112.          throw new NullPointerException();
  113.       } else {
  114.          reset(this.strm);
  115.          this.finished = false;
  116.          this.needDict = false;
  117.          this.off = this.len = 0;
  118.       }
  119.    }
  120.  
  121.    public synchronized void end() {
  122.       if (this.strm != 0L) {
  123.          end(this.strm);
  124.          this.strm = 0L;
  125.       }
  126.  
  127.    }
  128.  
  129.    protected void finalize() {
  130.       this.end();
  131.    }
  132.  
  133.    private static native void initIDs();
  134.  
  135.    private static native long init(boolean var0);
  136.  
  137.    private static native void setDictionary(long var0, byte[] var2, int var3, int var4);
  138.  
  139.    private native int inflateBytes(byte[] var1, int var2, int var3) throws DataFormatException;
  140.  
  141.    private static native int getAdler(long var0);
  142.  
  143.    private static native int getTotalIn(long var0);
  144.  
  145.    private static native int getTotalOut(long var0);
  146.  
  147.    private static native void reset(long var0);
  148.  
  149.    private static native void end(long var0);
  150.  
  151.    static {
  152.       AccessController.doPrivileged(new LoadLibraryAction("zip"));
  153.       initIDs();
  154.    }
  155. }
  156.