package zip;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

public final class d {
    public static byte[] a(byte[] arg7) {
        byte[] v0 = null;
        if(arg7 != null && arg7.length != 0) {
            ByteArrayInputStream v1 = new ByteArrayInputStream(arg7);
            ByteArrayOutputStream v2 = new ByteArrayOutputStream();
            try {
                GZIPOutputStream v3 = new GZIPOutputStream(((OutputStream)v2));
                byte[] v4 = new byte[4096];
                while(true) {
                    int v5 = v1.read(v4);
                    if(v5 <= 0) {
                        break;
                    }

                    v3.write(v4, 0, v5);
                }

                v3.finish();
                v3.close();
                v0 = v2.toByteArray();
           
            }
            catch(IOException v1_1) {
               
            }
        }

        return v0;
    }

    public static byte[] b(byte[] arg6) {// b_unZIP
        byte[] v0 = null;
        if(arg6.length != 0) {
            ByteArrayInputStream v1 = new ByteArrayInputStream(arg6);
            ByteArrayOutputStream v2 = new ByteArrayOutputStream();
            try {
                GZIPInputStream v3 = new GZIPInputStream(((InputStream)v1));
                byte[] v1_2 = new byte[4096];
                while(true) {
                    int v4 = v3.read(v1_2);
                    if(v4 <= 0) {
                        break;
                    }

                    v2.write(v1_2, 0, v4);
                }

                v2.flush();
                v0 = v2.toByteArray();

            }
            catch(IOException v1_1) {
               
            }
        }

        return v0;
    }
}
