0

我怎么告诉

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

遇到线路终端“\r\n”时停止读取缓冲区?

4

1 回答 1

1

像这样的东西:

String strLine = null;

//Read File Line By Line
while ((strLine = in.readLine()) != null  )   {
        if(strLine.contains("\r\n")){
                break;
             }


        }// end while

         in.close();
         ...
于 2013-03-22T16:36:38.117 回答