I am downloading zip file from server to internal storage. And after downloading I want to unzip that file in internal storage itself. My file is downloaded to internal storage and I can see that but while unzip I am not able to read it. Below is my unzipfile() method. Can anyone tell where I am going wrong?
public void unzipfile()
    {
        try {
            Log.d("unzipiing","unzipping");
            ContextWrapper cw = new ContextWrapper(context);
            String name_="foldername"; //Folder name in device android/data/
            File directory = cw.getDir(name_, Context.MODE_PRIVATE);
            File mypath=new File(directory,"dwnld");
            FileOutputStream fout = new FileOutputStream(mypath);
            File yourFile = new File(directory,"dwnld.zip");
            Log.d("unzipiing","filepath -" + yourFile.getPath());
            FileInputStream fin = new FileInputStream(yourFile.getPath());
            ZipInputStream zin = new ZipInputStream(fin);
            Log.d("unzipiing","zin size -" + zin.available());
           // zin.available() give -1 in console log
            BufferedInputStream in = new BufferedInputStream(zin);
            BufferedOutputStream out = new BufferedOutputStream(fout);
        byte b[] = new byte[zin.available()];
        int n;
            Log.d("unzip","n - " + in.read(b,0,1024));
        while ((n = in.read(b,0,1024)) >= 0) {
            out.write(b,0,n);
            Log.d("unzip byte"," - " + n);
        }
        out.flush();
        out.close();
            in.close();
            fin.close();
            zin.close();
        }
        catch (Exception e){
        }
    }
 
    