FileInputStream in = new FileInputStream("filetoreadfrom.txt");
while ((c = in.read()) != -1) {
Integer cobj = new Integer(c);
System.out.println("The Current data being read is :" + cobj.byteValue());
out.write(c);
}
The sysouts give an intvalue representing the byte being read.But i want to print the exact character being read.Is there a way to do it?
Try the type conversion
(char) cobj.byteValue()