How can I read a InputStream without a line break or <EOF>?

I'm having trouble by reading a InputStream without a line break or <EOF>.

If I insert a line break after the string that I'm using to make the testing, the program reads it perfectly.

But if not, it just freezes the program...

I'm new to Java, and I know that I'm not clear in my explanations, so please take a look in the code, as following.

Socket socket = serverSocket.accept();

PrintWriter out =new PrintWriter(socket.getOutputStream(),true);

BufferedReader in =new BufferedReader(new InputStreamReader(socket.getInputStream()));

String message = in.readLine();

How can I make the same operation, without inserting a line break?

[834 byte] By [erikitasa] at [2007-11-27 5:10:34]
# 1
> But if not, it just freezes the program...It's a normal behavior of the readLine() method.And, the line read by the readLine() method does not have newline character '\n'.If you don't like the behavior, use a character base or a byte base I/O.
hiwaa at 2007-7-12 10:30:42 > top of Java-index,Java Essentials,Java Programming...