public class JavaReadRemoteFile {
public static void main(String[] args) throws Exception {
URL url = new URL("http://127.0.0.1/Test1/upload/1.txt");
InputStream ism=url.openStream();
byte[] bytes=new byte[1024];
ism.read(bytes);
String str=new String(bytes,"utf-8");
System.err.println(str);
while(ism.read(bytes)>-1){
System.err.println(str);
}
}
}JAVA实现远程文件读取
最新推荐文章于 2024-08-05 05:06:18 发布

422

被折叠的 条评论
为什么被折叠?



