This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Finding the type of Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Finding the type of """ Watch "Finding the type of """ New topic

Finding the type of ""

Ameet Parande

Joined: Sep 10, 2003
Posts: 7
In java.lang.System it is defined as a reference to the "InputStream" interface.
On printing it - using a simple print like so:
System.out.println( );
it says it is of type "".
But BufferedInputStream is a decorator - I want to know who is the decoree.
Examaning the class object or using instanceof to does not help since the decoree is contained in the decorator.
Can anyone suggest a way I can find out the type of
Thanks in advance.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24183

Why do you want to know? It's going to be a non-public class, in any event.

[Jess in Action][AskingGoodQuestions]
Ameet Parande

Joined: Sep 10, 2003
Posts: 7
I was under the impression that it would wrap one of the polular public class from like: ByteArrayInputStream / PipedInputStream etc..
I am not stuck with a problem or anything, I was plainly curious of the implementation of: System.out and :-)
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
You can download the source code for the SDK and peruse through the .java files if you are interested. I do that myself every now and then when bored or curious of how things are really implemented under the hood.
It's nice not having to worry about implementation details, but it is sometimes fun to find them out!
I agree. Here's the link:
subject: Finding the type of ""
Similar Threads
Mark Help Me Out
[Decorator] delegating methods calls
Implementation/Design suggestions
Struts : display tag : column decorator
Design pattern help needed