package cn.dss.studay网络编程.mytomcat.URLDemo; import java.io.IOException; import java.io.InputStream; import java.net.URL; public class URLDemo { /** * 模拟解析器 * @param args * @throws IOException */ public static void main(String[] args) throws IOException { URL url = new URL("http://127.0.0.1:8080/myweb/1.html"); final InputStream inputStream = url.openStream(); final byte[] bytes = new byte[1024]; final int read = inputStream.read(bytes); String text=new String(bytes,0,read); System.out.println(text ); inputStream.close(); } }
java模拟解析器
最新推荐文章于 2024-04-24 21:55:50 发布