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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:42:03+00:00 2026-05-19T04:42:03+00:00

Hi I want to send a fixed amount of data (say 5MB) from server

  • 0

Hi I want to send a fixed amount of data (say 5MB) from server to Android client over TCP using the Java programming language. The data doesn’t matter it will be dropped at the client I am only doing this to do performance measurements on the phone.

Can anyone recommend a good way of accomplishing this? How can I have the server continually sending a large amount of data? Without the intermittent behaviour of reading a line from a file, then sending those bytes… then reading another line and sending those ones.

Ideas? Cheers.

  • 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-19T04:42:03+00:00Added an answer on May 19, 2026 at 4:42 am

    You don’t need to send a file, you could just send a block of data.

    // server which sends 5 MB on connection.
    ServerSocket ss = 
    Socket s = ss.accept();
    s.getOutputStream().write(new byte[5*1024*1024]);
    s.close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to send sensor data from an Android device to a Apache web
I have a client and a server I want to send objects from client
Hello Sir i want send list of data to php server i use following
I want to pass some data around threads but want to refrain from using
Want to send the text from my current vb application to the Active Window
I want to send SMS using LWUIT. what class should i be looking at?
I want to send html email.I am using spring framework Mailsender class to send
I want to transmit an int array over a network using Datagram Channel in
I want to serialize an object and send it over the network. I have
I'm writing a UDP server/client program in which the server send packets to client

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.