title: Reading a binary file into a string
body: <p>It must be obvious, but I can't figure it out. 
  I spent almost a whole day for this.
  I'll gladly buy a beer to someone who can lighten me.</p>
  
  <pre><code>File file = new File(filePath);
  byte[] bytes = new byte[(int)file.length()];
  DataInputStream dataInputStream = new DataInputStream(new BufferedInputStream(new FileInputStream(filePath)));
  dataInputStream.readFully(bytes);           
  dataInputStream.close();            
  return new String(bytes);
  </code></pre>
  
  <p>This is my code.
  I see that the byte array size is not OK, but I can't figure out the right size.
  Besides that the contents are not also incorrect.
  It seems that only the text characters are OK.</p>
  
  <p>It seems get out the data from a binary file is a real pain, I'm really depressed.</p>
  
  <p>One more thing: the file contents are not text, it can be anything like a picture, video, or pdf.</p>