I am trying to read from a Socket using BufferedReader as follows
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
while ((line = in.readLine()) != null)
{
}
I input a string, say “AUTH”, I am getting the value of line variable as ÿûÿû ÿûÿû’ÿýÿûÿýAUTH
Any solution to this problem?
That just means the extra data is in the socket for whatever reason. My guess is that you’re using telnet to connect to the server, and that’s the telnet protocol negotiation.
Java won’t add extra data to what’s genuinely there.