由于将java项目打包成jar包后获取不到resource目录下的文件,则需要时间转换成流
具体代码如下:
try
{
//返回读取指定资源的输入流
InputStream in=this.getClass().getClassLoader().getResourceAsStream("ip.csv");
br = new BufferedReader(new InputStreamReader(in));
} catch (Exception e)
{
e.printStackTrace();
}

相关文章:

  • 2021-06-08
  • 2021-06-14
  • 2021-11-28
  • 2021-04-17
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2021-05-31
  • 2021-12-25
  • 2021-10-17
相关资源
相似解决方案