import java.io.*;
public class Resource {
public void getResource() throws IOException{
//返回读取指定资源的输入流
InputStream is=this.getClass().getResourceAsStream("/resource/res.txt");
BufferedReader br=new BufferedReader(new InputStreamReader(is));
String s="";
while((s=br.readLine())!=null)
System.out.println(s);
}
}
点击打开链接http://www.iteye.com/topic/483115
java从jar包中获取资源文件
最新推荐文章于 2024-01-22 18:15:39 发布