1、NIO包中的操作
String content = new String(Files.readAllBytes(Paths.get(ClassLoader.getSystemResource("static/xxxx.txt").toURI())), "utf-8");
2、ClassPathResource 读取 inputstream
ClassPathResource classPathResource = new ClassPathResource("static/xxx.txt");
InputStream inputStream = classPathResource.getStream();
int fileLength = (int) classPathResource.getFile().length();
byte b[] = new byte[fileLength];
inputStream.read(b);
inputStream.close();
String str = new String(b, "utf-8");