title: how to convert a binary file into a text readable file using java
body: <p>I'm trying to convert a binary content of a file to a readable text file using a java code.
  This is the code used so far which doesn't give a readable text content:</p>
  
  <pre><code>public static void main(String[] args) throws IOException {
  
      File file = new File("C:\\Users\\Sami\\Desktop\\example-trace");
  
      int ch;
      StringBuffer strContent = new StringBuffer("");
          FileInputStream fin = null;
  
  
    fin = new FileInputStream(file);
  
    while( (ch = fin.read()) != -1)
      strContent.append((char)ch);
       fin.close();
  
           System.out.println(strContent);
  }
  </code></pre>