Link to home
Start Free TrialLog in
Avatar of DaFou
DaFou

asked on

converting charcode to String

HI All,

I use lBufferedReader.read() to read single characters from a Stream. But what frustrates me is that it does not return a String but rather an integer.
How do I convert this int to a String?
SOLUTION
Avatar of radarsh
radarsh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DaFou
DaFou

ASKER

but I need to convert a CharCode to the actual character it represents
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DaFou

ASKER

I am trying to read all of an HTTP request. the request are characters but the read() returns a single int per call.
the int returned I suppose is the CharCode.

HOw do I convert the CharCode to the actual character?
Just do it the simple way. Read an int, convert it to char (the conversion here is correct) and add the char to the existing string:

s += (char)br.read();
glad to help