BufferedReader ready() method with httpsconnection

I just joined as I am just starting to work in Java. I have aproblem using httpsconnection with a bufferedreader and checking theready(). When the network is slow, my bufferedreader will not beready() and I will sleep for a few seconds before checking again.But, once the ready() has gone to false, it never comes back andbecomes true no matter how long I sleep or who many times I checkback.

Has anyone had this experience?. Here is the code I am running toread the line from the bufferedreader. It will get part way throughand then ready() becomes false and never goes back to true.

//----------------------------------------// Read a timed bufferpublic String readBufferLine(){String line = null;boolean done = false;boolean slept = false;boolean brtest = false;boolean bufferready = false;int trycounter = 0;// while trying to read the line loopwhile (!done){// if the maximum number of tries have occurred, exit theloopif (trycounter > timeout){System.out.println("Time exceeded...");line = defaultstr;done = true;}// if maximum number of tries have not occured, try toread the lineelse{// increment the try countertrycounter = trycounter + 1;// check to see if the buffer is readytry{brtest = br.ready();}catch (IOException ioe){// error occurred when check if the buffer isreadySystem.out.println("Error occurred while testingbuffer...");line = defaultstr;done = true;}// if buffer is not ready and no error has yetoccurred, sleep for a bitif (!done && !brtest){try{// sleepslept = true;Thread.sleep(timesleep);System.out.print("*");}catch (Exception e){// error occurred while sleepingSystem.out.println("Error occurred whilesleeping...");line = defaultstr;done = true;}}// no error has occurrec and buffer is ready to bereadelse if (!done){try{// read the line from the bufferline = br.readLine();}catch (IOException ioe){// an error occurred ready the bufferSystem.out.println("Error occurred whiletesting buffer...");line = defaultstr;done = true;}// Check if it is the end of the reader (last lineis "")if (line == null){System.out.println("End of file...");}done = true;}}}// a delay happend at some pointif(slept){System.out.println("!");}return line;}// end method readBufferLine//--------------------------------------------------