java简单实现B/S服务器时接收浏览器客户端的请求信息时出现乱码
publicclassBSServer1{publicstaticvoidmain(String[]args)throwsIOException{ServerSocket...
public class BSServer1 { public static void main(String[] args) throws IOException { ServerSocket serve = new ServerSocket(8000); Socket socket = serve.accept(); InputStream is = socket.getInputStream(); byte[] bytes = new byte[1024]; int len = is.read(bytes); System.out.println(new String(bytes,0,len)); socket.close(); serve.close(); }}
展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询