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 951797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:47:36+00:00 2026-05-15T23:47:36+00:00

I have 40 MB file in server and i am downloading my file using

  • 0

I have 40 MB file in server and i am downloading my file using

HttpURLConnection c = (HttpURLConnection) u.openConnection();
 c.setRequestMethod("GET");
 c.setDoOutput(true);
 c.connect();
 FileOutputStream f = new FileOutputStream(new File("trips.xml"));


 InputStream in = c.getInputStream();

 byte[] buffer = new byte[1024];
 int len1 = 0;
 while ( (len1 = in.read(buffer)) != -1 ) {
  f.write(buffer,0, len1);

this code seems working fine but it is taking too long. is their any way I can make this process faster.

/minhaz

  • 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-05-15T23:47:37+00:00Added an answer on May 15, 2026 at 11:47 pm

    This very ugly hack which might give you a faster download time, or maybe it doesn’t, you’ll have to test it under your conditions:

    Start several parallel connections (in separate threads?), and each one should download a different chunk of data (using HTTP 1.1 Range header). Depending on many things like if there’s a full moon, or the sun is out or the roses are blooming you might get better results because it will saturate your link better than a single connection (to the expense of everyone else sharing your link, kinda like what BitTorrent does).

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

Sidebar

Related Questions

I have a Struts2 action in the server side for file downloading. <action name=download
I'm using PuTTY to access my BSD file server and I have several terminal
I have an mp3 file on a server. I want to get this file's
I have an assignment about uploading and downloading a file to a server. I
I have an assignment about uploading and downloading a file to a server. I
I have many XML-s and I downloaded using file or file_get_content, but the server
I am using navigateToURL for file downloading from server. Is there anyway possible to
I have a file server and wanting to optimize it the best I can,
I have a file on my server that's outside of my app directory. It's
I have to develop a file server service that transfer file form a specified

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.