File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 60041
    
  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: 19538
    
  16

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
 
Similar Threads
Data Stream and Byte Stream
== and .equals()
getResource & getRealPath
difference between error and runtime exception
What is the diff. between character-stream and byte stream which one is better?why?