I looked at the file and it appears to be formatted, but I'm not sure what the format is. However, the question remains as to what you are trying to do as you are currently just reading in each character one at a time and storing it in your int , upto 5000 chars, then outputting the decimal equivalent of each of those chars. Is this intended?
actually i m reading the whole file and converting it into decimal value. The above code is just a demo. In real i have to read the whole file. I also conveerted some entended int values to ascii and save that file. next i read the same file and converted to int. its showing wrong values.
You have non-readable/printable characters in your input file. In c#, a "char" (Unicode representation) is 2 bytes, or 2^16, which has a max value of 65536. I'm not sure what it is you expect. You could force the output to be max byte length:
but, I don't know how that helps you or what you are trying to do...