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

  • Home
  • SEARCH
  • 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 8563699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:01:14+00:00 2026-06-11T17:01:14+00:00

I am writing a client-server program in JAVA in which I am sending a

  • 0

I am writing a client-server program in JAVA in which I am sending a file from server to client.As the file size may be quite high therefore I decided to divide the file in 5 parts and then send it to the same client in 5 different Threads.

  • My Algorithm is to use Java Zip API and create a zip file of the file to be sent,then I will divide the Zip file into 5 parts.
    The problem is that there is not method in [ZIP API][2] that could divide the file.
    This is the tutorial that I am referring for sending files through Thread.
    Anyone who can guide me is there anything wrong with my Algorithm Or do I have to do with different strategy?
  • 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-11T17:01:15+00:00Added an answer on June 11, 2026 at 5:01 pm

    You should separate the zipping part from the splitting part. If you have to send these to a client, you probably don’t want to keep the complete zip file in memory while you wait for the client to request the next chunk… so the simplest approach would be to zip to disk first, and then serve that file in chunks. At that point, it really doesn’t matter that it’s a zip file at all – and indeed for certain files types (e.g. images, sound, video) you may not want to go via a zip file at all.

    I would suggest you tell the client the file name and size, and then let the client request whatever section of the file it wants. It can then decide what chunk size to use: you just need to seek to the right bit of the file and serve as much data as the client has requested.

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

Sidebar

Related Questions

I'm writing my first java client/server program which just establishes a connection with the
What I'm doing : I am writing a program on client-server file transfer through
I'm writing a client-server program in java. The basis is that the program presents
I'm writing a basic Server-client program in Java and I'm trying to handle the
This is a conceptual programming question. I'm writing a tcp server/client program in Java.
I'm writing a client-server solution which is using Java RMI (Via the Cajo project).
I am writing a client/server program using C sockets. I am specifying that the
I'm writing a client for a server program written in C++. As is not
I'm writing a client application to communicate with a server program via UDP. The
So I'm writing a program that is suppose to run forever (client server stuff)

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.