home *** CD-ROM | disk | FTP | other *** search
- package java.util.zip;
-
- import java.security.AccessController;
- import sun.security.action.LoadLibraryAction;
-
- public class Inflater {
- private long strm;
- private byte[] buf;
- private int off;
- private int len;
- private boolean finished;
- private boolean needDict;
-
- public Inflater(boolean var1) {
- this.buf = new byte[0];
- this.strm = init(var1);
- }
-
- public Inflater() {
- this(false);
- }
-
- public synchronized void setInput(byte[] var1, int var2, int var3) {
- if (var1 == null) {
- throw new NullPointerException();
- } else if (var2 >= 0 && var3 >= 0 && var2 + var3 <= var1.length) {
- this.buf = var1;
- this.off = var2;
- this.len = var3;
- } else {
- throw new ArrayIndexOutOfBoundsException();
- }
- }
-
- public void setInput(byte[] var1) {
- this.setInput(var1, 0, var1.length);
- }
-
- public synchronized void setDictionary(byte[] var1, int var2, int var3) {
- if (this.strm != 0L && var1 != null) {
- if (var2 >= 0 && var3 >= 0 && var2 + var3 <= var1.length) {
- setDictionary(this.strm, var1, var2, var3);
- this.needDict = false;
- } else {
- throw new ArrayIndexOutOfBoundsException();
- }
- } else {
- throw new NullPointerException();
- }
- }
-
- public void setDictionary(byte[] var1) {
- this.setDictionary(var1, 0, var1.length);
- }
-
- public synchronized int getRemaining() {
- return this.len;
- }
-
- public synchronized boolean needsInput() {
- return this.len <= 0;
- }
-
- public synchronized boolean needsDictionary() {
- return this.needDict;
- }
-
- public synchronized boolean finished() {
- return this.finished;
- }
-
- public synchronized int inflate(byte[] var1, int var2, int var3) throws DataFormatException {
- if (var1 == null) {
- throw new NullPointerException();
- } else if (var2 >= 0 && var3 >= 0 && var2 + var3 <= var1.length) {
- return this.inflateBytes(var1, var2, var3);
- } else {
- throw new ArrayIndexOutOfBoundsException();
- }
- }
-
- public int inflate(byte[] var1) throws DataFormatException {
- return this.inflate(var1, 0, var1.length);
- }
-
- public synchronized int getAdler() {
- if (this.strm == 0L) {
- throw new NullPointerException();
- } else {
- return getAdler(this.strm);
- }
- }
-
- public synchronized int getTotalIn() {
- if (this.strm == 0L) {
- throw new NullPointerException();
- } else {
- return getTotalIn(this.strm);
- }
- }
-
- public synchronized int getTotalOut() {
- if (this.strm == 0L) {
- throw new NullPointerException();
- } else {
- return getTotalOut(this.strm);
- }
- }
-
- public synchronized void reset() {
- if (this.strm == 0L) {
- throw new NullPointerException();
- } else {
- reset(this.strm);
- this.finished = false;
- this.needDict = false;
- this.off = this.len = 0;
- }
- }
-
- public synchronized void end() {
- if (this.strm != 0L) {
- end(this.strm);
- this.strm = 0L;
- }
-
- }
-
- protected void finalize() {
- this.end();
- }
-
- private static native void initIDs();
-
- private static native long init(boolean var0);
-
- private static native void setDictionary(long var0, byte[] var2, int var3, int var4);
-
- private native int inflateBytes(byte[] var1, int var2, int var3) throws DataFormatException;
-
- private static native int getAdler(long var0);
-
- private static native int getTotalIn(long var0);
-
- private static native int getTotalOut(long var0);
-
- private static native void reset(long var0);
-
- private static native void end(long var0);
-
- static {
- AccessController.doPrivileged(new LoadLibraryAction("zip"));
- initIDs();
- }
- }
-