Hi guys,
Really got interested in the discussion and tried your code but unfortunately it works when i run through intel Idea.
Iam getting different results when i run through idea and through command prompt infact iam using the same class file. Here is the code that i tried
FileInputStream is = new FileInputStream("D:\\test\\test.txt");
StringBuffer sb = new StringBuffer();
while ((ch = is.read()) != -1)
{
sb.append((char) ch);
}
int i = 0;
while (sb.length() > i)
{
System.out.print("["+ ((int)sb.charAt(i)) +"-'"+sb.charAt(i)+"']");
i++ ;
}
The result i got through Idea:
[104-'h'][13-'
'][10-'
'][112-'p'][13-'
'][10-'
'][100-'d'][13-'
'][10-'
'][13-'
'][10-'
'][104-'h']
and through command prompt:
'][10-''][13-'
'][10-''p'][13-'
'][10-''d'][13-'
'][10-'
'][104-'h']
I really don't understand what makes the difference
NOTE:Iam using the same class file
Hope it adds much confusion
regards
Yacoob