When I am taking input from file using Ubuntu as OS, DataInputStream is giving different values from the number in file. What to do about it??

I dont know much about file int, I also tried out using BufferedStream, Still getting some strange values.

Please reply soon.

Member Avatar
harsh2327

read() method in BufferedStream returns an int .

If you are want to read characters then you will have to typecast the integer to char like

char c = (int)<YOUR_OBJECT_HERE>.read()