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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:41:30+00:00 2026-06-17T16:41:30+00:00

I want to transfer a big file between server and client, I know how

  • 0

I want to transfer a big file between server and client, I know how to do this:
for the client side, the code is like :

OutputStream output = sk.getOutputStream();     

    FileInputStream fileInputStream = new FileInputStream(file);
    byte[] buffer = new byte[1024*1024];
    int bytesRead = 0;

    while((bytesRead = fileInputStream.read(buffer))>0)
    {
        output.write(buffer,0,bytesRead);
    }

    fileInputStream.close();

for server side:

InputStream input = sk.getInputStream();

    file = new File(filename);
    FileOutputStream out = new FileOutputStream(file);

    byte[] buffer = new byte[1024*1024];

    int bytesReceived = 0;

    while((bytesReceived = input.read(buffer))>0) {
        out.write(buffer,0,bytesReceived);
        System.out.println(bytesReceived);
        break;
    }

Now the problem is, the server and client agree on a 128-bit AES key, so I want to make fully use of the session key to make the file transfer process secure. My question is that, where can I insert the AES encryption process in my client and server? Thank you!

  • 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-17T16:41:31+00:00Added an answer on June 17, 2026 at 4:41 pm

    I think you could use javax.crypto.CipherInputStream / javax.crypto.CipherOutputStream. Usage example http://www.flexiprovider.de/examples/ExampleCrypt.html

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

Sidebar

Related Questions

I want to write Python code to send a file from client to server.
I just want to transfer (send or receive) a hash from client to server.
In my java application I want to transfer some Images from client to server.
I want to transfer data from a vertical db layout like this: --------------------- |
I want to transfer XML from client to some server using FTP . What
I want to transfer files between any 2 active users on my website and
Suppose I want to transfer just a portion of a file over FTP -
I have a JavaScript app that produces a string. I want to transfer this
i want to know how to transfer geopoint to address Example double src_lat =30.022584
I want server.transfer to transfer the control to a different website other than the

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.