Resource resource1 = new ClassPathResource("Beans.xml");
Resource resource2 = new UrlResource("Beans.xml");
Resource resource3 = new InputStreamResource(new FileInputStream(new File("Beans.xml")));
Resource resource4 = new ByteArrayResource("helloworld".getBytes());
分别对应文件,classpathResource,UrlResource,inputstream资源,byte数组


![[夜寂]Spring中Resource接口有关的实现 [夜寂]Spring中Resource接口有关的实现](http://www.mshxw.com/aiimages/31/713537.png)
