方法代码:
ClassLoader loader = Thread.currentThread().getContextClassLoader();
InputStream flagInputStream = loader.getResourceAsStream("static/imagesLogo/imageaaa.png");
BufferedImage read;
read = ImageIO.read(flagInputStream);
System.out.println("测试读取图片" + read);
InputStream resourceAsStream = LectureMessageServiceImpl.class.getClassLoader().getResourceAsStream("static/imagesLogo/imageaaa.png");
BufferedImage read2;
read2 = ImageIO.read(resourceAsStream);
System.out.println("测试读取图片" + read2);