JAVA为服务器的:
pw.write(str);
pw.flush();android是客户端:
public void run() {
// TODO Auto-generated method stub
String buf;
try {  
            while (true) {  
                if (!socket.isClosed()) {  
                    if (socket.isConnected()) {  
                        if (!socket.isInputShutdown()) {  
                            if ((buf=in.readLine())!= null) {  
                                //content += "\n";
                             content=content+buf+"\n";
                                mHandler.sendMessage(mHandler.obtainMessage());  
                            } else {  
  
                            }  
                        }  
                    }  
                }  
            }  
        } catch (Exception e) {  
            e.printStackTrace();  
        }  
}
谁能帮忙解决一下,接收后content总是少了最后一行.