In your code
bw.write(message+"\n");
As it will put \n
after all message has been written.
BufferedWriter
will not send 6 Messages it will send only one but as you gave \n
in your string it will write according to that.
As delv said you can put escape sequence to the \n
so that it will write only one line.
String message = "LOOKREPLY\\nX...X\\n.....\\n.....\\n.....\\nX...X";
So that message will be written like this.
LOOKREPLY\nX...X\n.....\n.....\n.....\nX...X