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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?
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();
s += (char)br.read();
glad to help
ASKER