用socket实现客户端和服务器端通信,用字符流,怎么写啊?

2025-04-05 09:51:26
推荐回答(1个)
回答1:

String line;
BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));

while((line = br.readLine()) != null){
//

}