java - Android: downloading large zipped file -


i've got problem in downloading large zipped file in android. when i'm downloading small file (i.e. 20 mb) ok, when trying download large file (i.e 100 mb) cannot unzip after downloading because corrupt. here code:

        final url url = new url(url));         final httpurlconnection urlconnection = (httpurlconnection) url.openconnection();          file file = new file(mcontext.getfilesdir(), params[0]);         file.getparentfile().mkdirs();         fileoutputstream fos;         fos = new fileoutputstream(file);          inputstream input = urlconnection.getinputstream();         bufferedinputstream bis = new bufferedinputstream(input);          byte[] buffer = new byte[1024];         int read = bis.read(buffer);          while(read != -1){             fos.write(buffer, 0, read);             read = bis.read(buffer);         }          fos.close();         bis.close(); 


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -