Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8814757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:12:36+00:00 2026-06-14T04:12:36+00:00

Possible Duplicate: Android: HTTP communication should use Accept-Encoding: gzip My Android application downloads temp.bin

  • 0

Possible Duplicate:
Android: HTTP communication should use “Accept-Encoding: gzip”

My Android application downloads temp.bin file but today it (file) too big. I configured Apache to compress it to temp.bin.gz by using gzip. So i got 10% from actual size.

So far so good. Now the problem is how to decompress it in Android side during downloading.

I used before this snippets of download algorithm:

    URL url = new URL(urlStr);

        // set redirect mode ...        
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setInstanceFollowRedirects(true);

        connection.setConnectTimeout(0);
        connection.setReadTimeout(0);
        connection.setUseCaches(false);
        connection.setAllowUserInteraction(false);

        connection.connect();  

                    ....

InputStream in = null;
        //boolean lengthValid = (contentLength != -1); 

        byte    bytes[] = new byte[256];
        int     total_count = 0;
        int     max_count = 0;

        try {
            in = connection.getInputStream();
            int count = 0;


            while (count != -1){
                count = in.read(bytes);
  ....

Any and all suggestions would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:12:37+00:00Added an answer on June 14, 2026 at 4:12 am

    Simply use java.util.zip.GZIPInputStream instead of InputStream

    Also See

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: HTTP POST response into WebView in android In my Android Application i
Possible Duplicate: Android Launch an application from another application I am having a problem
Possible Duplicate: Android HttpClient : NetworkOnMainThreadException I am working on an application that is
Possible Duplicate: android pressing back button should exit the app I'm building a register
Possible Duplicate: Android Webview - Webpage should fit the device screen I want to
Possible Duplicate: Android Launch an application from another application I want to start Another
Possible Duplicate: Android - Application (apk) Maximum size I want to install an APK
Possible Duplicate: Download a file with Android, and showing the progress in a ProgressDialog
Possible Duplicate: android.os.NetworkOnMainThreadException When I run the my android application, I got android.os.NetworkOnMainThreadException, what
Possible Duplicate: Android ImageButton with a selected state? I was wondering whether there is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.