getResourceAsStream与其它获取 InputString 方法的差异

getResourceAsStream:

Finds the resource with the given name. A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code.

The name of a resource is a '/'-separated path name that identifies the resource.

This method will first search the parent class loader for the resource; if the parent is null the path of the class loader built-in to the virtual machine is searched. That failing, this method will invoke findResource(String) to find the resource. 

posted on 2011-11-15 12:38  大松  阅读(147)  评论(0编辑  收藏  举报