purpose
Jar read in the resource file
principle
Class loader encapsulated to obtain resources (the Jar as a whole, can not be used to locate the URI package file)
algorithm
- Get the class loader
- Obtain specific resource file input stream
Algorithms practice
类名.class.getClassLoader().getResourceAsStream("资源文件在包内的相对位置");