android套接字TCP线路终结器

时间:2013-03-22 16:31:58

标签: android sockets buffer terminator

我该怎么说

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

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

1 个答案:

答案 0 :(得分:1)

类似的东西:

String strLine = null;

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


        }// end while

         in.close();
         ...