title: How to read ASCII characters using Java?
body: <p>My requirement is to convert a number to binary format and read the binary data and play with it (like reverse of string etc).</p>
  
  <p>My input is <code>int i=12937</code>.</p>
  
  <p>Below is my code to create binary data:</p>
  
  <pre><code>int i = 12937
  DataOutputStream os = new DataOutputStream(new 
  FileOutputStream("D:\\binout.dat"));
  os.writeInt(i);
  os.close();
  </code></pre>
  
  <p>Output is: <code>2‰</code></p>
  
  <p>I was reading the file data and trying to print it then it is printing this value: 2? </p>
  
  <pre><code>DataInputStream d = new DataInputStream(new 
  FileInputStream("D:\\binout.dat"));
  String count;
  while((count = d.readLine()) != null){
      System.out.println(count);
  }
  </code></pre>
  
  <p>Output: 2?</p>
  
  <p>Java code is reading "‰" this symbol and converting it to "?"</p>
  
  <p>Is there any way that I could directly read "‰" the symbol and print it on the console?</p>