title: Error Sending ONLY Image/Video file
body: <p>I'm trying to share files between my pc &amp; android device over wifi. Strange thing is text and audio files are being perfectly transferred, while the images and video files fail to render. 
  Here's the main piece of code: </p>
  
  <p><strong>Sender:</strong></p>
  
  <pre><code>BufferedOutputStream writer = new BufferedOutputStream(client.getOutputStream());
  InputStream stream = new FileInputStream(file);
  while ((read = stream.read(buffer)) != -1)
      writer.write(buffer, 0, read);
  </code></pre>
  
  <p><strong>Receiver:</strong></p>
  
  <pre><code>BufferedInputStream input = new BufferedInputStream(client.getInputStream());
  OutputStream outputStream = new FileOutputStream(file, true);
  while (!store.complete) {
      read = input.read(buffer, 0 , MAX_SIZE_OF_BUFFER);
      String data = new String(buffer);
      // Need to do some data manipulation (like removing a string which i appended
      // while sending )
      outputStream.write(data.getBytes());
  }
  </code></pre>
  
  <p><strong>Note: Even the size of the image/video file at the receiver is equal to the file being sent, still it fails to render.</strong></p>
  
  <p>Thanks in Advance!! :)</p>