aspose file tools*
The moose likes Beginning Java and the fly likes Difference between the getResource and getResource as a Stream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Difference between the getResource and getResource as a Stream" Watch "Difference between the getResource and getResource as a Stream" New topic
Author

Difference between the getResource and getResource as a Stream

kiranb reddy
Greenhorn

Joined: Sep 28, 2008
Posts: 20
Hi,

Could anyone please, explain the difference between the getResource and getResource as a stream.

Please explain me with an example.


Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60992
    
  65

Was the Javadoc not clear? What aspects need clarification?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

One returns a URL, one returns an InputStream. That's pretty clear to me.

In fact, getResourceAsStream is actually shorthand for the following:

Copied directly from the Java 6 source code of ClassLoader.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between the getResource and getResource as a Stream