支持linux下读取

import org.springframework.core.io.ClassPathResource;
 
public byte[] getCertStream(String path) {
          try {
            ClassPathResource classPathResource = new ClassPathResource(path);
            //获取文件流
            InputStream stream = classPathResource.getInputStream();
            byte[] content = IOUtils.toByteArray(stream);
            stream.read(content);
            stream.close();
       return content; }
catch (IOException e) { e.printStackTrace(); } }

 

相关文章:

  • 2022-12-23
  • 2021-11-10
  • 2019-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2021-08-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
  • 2022-01-07
相关资源
相似解决方案