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