views:

220

answers:

5

I using readLine() method for reading the text, but i am not aware of how many text can read that method. Ex.

String str = in.readLine();

how many texts can read and store on "str"?

+1  A: 

Till LINE BREAK, loosely speaking. For the exact, see Matthew's answer. Cheers.

Adeel Ansari
This is not strictly true; see @Matthew's answer.
Stephen C
@Stephen: Cent percent agreement. I didn't think that much at that time ;).
Adeel Ansari
A: 

it will read as many as are available until it encounters an eol

objects
+4  A: 

Integer.MAX_VALUE, but you obviously should not be running into this limit very often.

Matthew Flaschen
+1 - and note that this is because `Integer.MAX_VALUE` is the maximum size for a Java String.
Stephen C
A: 

This bug leads me to believe there is no limit.

David Kanarek
A: 

If you need to ask this question you have a much bigger problem. Why are the lines you are reading so long that you need to worry about it? This is evidence of poor design upstream.

EJP