title: Unable to do fast I/O of dynamically generated images on a IP camera
body: <p>I have a image file stored at a remote server (i.e <a href="http://example.com/images).The" rel="nofollow noreferrer">http://example.com/images).The</a> images in this folder are getting updated at the rate of 1 image per 100 milliseconds 
  <strong><em>Think of ip cams that transmit MJPEG images</em></strong> .</p>
  
  <p>I am using apache HTTP client api to connect to my remote server .I am getting a stream of the content</p>
  
  <pre><code>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();
  </code></pre>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>But whatever samples I have seen talk about creating FileInputStream / RandomAccessFiles which take File Object as parameter.</p>
  
  <p>I am getting the InputStream as response from remote server which I am unable to convert to FileInputStream to get FileChannel.</p>
  
  <p>I would like to know if there is any implementation in apache http client api that gives fileChannels.</p>
  
  <p>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</p>