将文件暂存到主机,用于读取流

//摘要
String zy = lwxx.getZy();
//送审学号
String ssxh = lwxx.getSsxh();
byte[] bytes = new byte[0];
if (StrUtil.isNotBlank(zy)) {
    bytes = zy.getBytes();
}
//文件名称
String name = "10423_"+ ssxh + "_ZY.txt";
//将信息暂存到本机,不写入,用于读取文件流
File file = new File(this.getClass().getResource("/").getPath() + name);
FileOutputStream fos = new FileOutputStream(file);
fos.write(bytes);
fos.close();
InputStream is = new FileInputStream(path);

 

posted @ 2021-02-05 11:05  这个队友好拉风  阅读(25)  评论(0)    收藏  举报