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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:49:02+00:00 2026-05-15T12:49:02+00:00

I have a image file stored at a remote server (i.e http://example.com/images).The images in

  • 0

I have a image file stored at a remote server (i.e http://example.com/images.The) images in this folder are getting updated at the rate of 1 image per 100 milliseconds
Think of ip cams that transmit MJPEG images .

I am using apache HTTP client api to connect to my remote server .I am getting a stream of the content

HttpClient httpClient = new DefaultHttpClient();
    HttpGet httpget = new HttpGet("http://example.com/images/screenshot.jpg");
    HttpResponse response = httpClient.execute(httpget);
    HttpEntity entity = response.getEntity();
    if (entity != null) {
    InputStream instream = entity.getContent();

I am wrapping up the input stream in BufferedInputStream for faster I/O .But since the images are getting generated at very fast rate and they are on an average 250kb in size.

I would like to use the NIO features like FileChannel as well as MemoryMappedBuffers to
improve the I/O performance as well access generated image files on remote server in non blocking mode.

But whatever samples I have seen talk about creating FileInputStream / RandomAccessFiles which take File Object as parameter.

I am getting the InputStream as response from remote server which I am unable to convert to FileInputStream to get FileChannel.

I would like to know if there is any implementation in apache http client api that gives fileChannels.

Or should i explore sockets to get the channel access.
I have also exlored javax.imageIO , but not sure if it will meet my requirement of faster I/O

  • 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-15T12:49:03+00:00Added an answer on May 15, 2026 at 12:49 pm

    Your limiting factor is going to be the network. If you have a 1mbps line, that means your practical max transfer will probably be about 100 kilobytes per second (I realise 8 bits to the byte, but given communication overhead the typical observed transfer tends to be 10-to-1).

    If you’re looking to pull down 10 images per second, and each image is 250k, you need a 25 mbps network connection.

    Sockets might offer minor improvements, but it will still not achieve what you want. Have you considered compression? E.g. on server, assemble several images into a compressed archive, download, and uncompress. This still will not get you 10 250k images per second, but could get you closer.

    Another option may be to use a video stream, unless you absolutely need images.

    If you absolutely need 10 images per second, you need to either increase the speed of your connection to the server or reduce the size of the images, or some combination of both.

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

Sidebar

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.