title: not able to transfer Image file
body: <p>hi this is my client program for transfering  Image , while transfering the image file it is getting corrupted , not able to open that image file , i'm not able to identify the bug , can any one help me. </p>
  
  <pre><code>DataInputStream input = new DataInputStream(s.getInputStream());
  
  DataOutputStream output = new DataOutputStream(s.getOutputStream());
  
  System.out.println("Writing.......");
  
  FileInputStream fstream = new FileInputStream("Blue hills.jpg");
  
  DataInputStream in = new DataInputStream(fstream);
  
  byte[] buffer = new byte[1000];
  int bytes = 0;
  
  while ((bytes = fstream.read(buffer)) != -1) {
      output.write(buffer, 0, bytes);
  }
  
  in.close();
  </code></pre>