I am currently working on a Client/Server project. Up until now both have been in C++ and now I am making my client Java based. In order to receive from the Server I have been using a
BufferedReader in = new BufferedReader(new InputStreamReader(Socket.getInputStream()));
and Have been using
in.readLine()
The problem is when I need to receive multiple lines from the Server, the client stops after the first line because of the '\n' character.
How do i avoid this happening and receive all of the info?
I thought of using a char[] like this:
char[] buffer = new char[1024];
but the problem is that when the client receives the next message there is still left overs in the buffer.
Any help would be great!
Thanks