readling all of the BufferedReader
Posted on 2004-11-29
I want to fill up a string withh all there is in the BufferedReader, But i can only read line by line.
And when I loop through it my code hangs:
please debug this code:
InputStream lInputStream = lSocket.getInputStream();
BufferedReader lBufferedReader = new BufferedReader( new InputStreamReader( lInputStream ) );
String lStrRequest = "";
String lStr = lBufferedReader.readLine();
while ( lStr != null ) // why is this loop never ending and makes my code hang?
lStrRequest += lStr;
lStr = lBufferedReader.readLine();
System.out.println( lStrRequest );