title: Copy a mp4 stream with InputStream and OutputStream
body: <p>I have a mp4 file which I want to copy.  </p>
  
  <pre><code>byte buffer = new byte[1024];
  inputStream = new FileInputStream(Mp4FileIN);
  outputStream = new FileOutputStream(Mp4fileOUT);
  
  int length;             
  while((length = inputStream.read(buffer)) &gt; 0)
        fileOutStream.write(buffer, 0, length);           
  
   fileOutStream.close();
  </code></pre>
  
  <p>Bytes of the output file are exactly the same of the original, but clearly it is not the same file.</p>
  
  <p>Why I can't play it?</p>
  
  <p>What is wrong in this approach?</p>
  
  <p>Thanks.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I've just realized, that after some attemps, sometimes it works, sometime it doesn't.
  So my question is the same, what is wrong with my approach?</p>