Hey guys -
Pretty basic question. I'm using a PrintWriter attached to an OutputStream, with a readLine loop that looks like this:
The BufferedReader and PrintWriter are both attached to to Socket streams. Output loop server-side looks like this:
The problem is that the strings are always cut off at the last \n, with the remainder to be included in the next readLine, which is unabridged save for what lays beyond its own final "\n".
Thoughts?
EDIT: Here's an example of a
string that is severed.
"Which profession is your character?\n" +
"Choose from:\n1) Monk\n2) Psionist\n3) Berserker\n4) Mage";
In this case, "\n4)Mage" is transplanted.
EDIT2: So I decided to try and rewrite the whole thing with @n instead of \n, and then build my own code for recognizing @n as \n. Now the entire line, before and after @n, gets transplanted to the next Writer.println(). How does that make sense at all? o.O
[ December 28, 2008: Message edited by: Alex Birmingham ]