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 for 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()

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.