This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
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
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 56150
    
  13

Was the Javadoc not clear? What aspects need clarification?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19214

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
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: Difference between the getResource and getResource as a Stream
 
Similar Threads
difference between error and runtime exception
What is the diff. between character-stream and byte stream which one is better?why?
Data Stream and Byte Stream
== and .equals()
getResource & getRealPath