File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes FilterInputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "FilterInputStream" Watch "FilterInputStream" New topic
Author

FilterInputStream

Hans Li
Greenhorn

Joined: Oct 13, 2000
Posts: 10
I want to construct an instance of FilterInputStream as
FilterInputStream fi=new FilterInputStream(System.in);
but compiler say it's error.
I don't knoe how to construct it.
Thnak you
Oliver Grass
Ranch Hand

Joined: Nov 02, 2000
Posts: 65
Hi Hans,
you can't create an instance of a FilterInputStream directly, cause the Constructor is protected.
You should use one of the already defined subclasses, for example BufferedInputStream...
Or you can define your own FilterInputStream by subclassing FilterInputStream.
Hope that helps
Oliver
Originally posted by Hans Li:
I want to construct an instance of FilterInputStream as
FilterInputStream fi=new FilterInputStream(System.in);
but compiler say it's error.
I don't knoe how to construct it.
Thnak you

Bin Zhao
Ranch Hand

Joined: Oct 04, 2000
Posts: 73
Pay attention to FileInputStream 's constructors:
FileInputStream(File file)
FileInputStream(FileDescriptor fdObj)
FileInputStream(String name)
System.in is an InputStream
how can it be taken as a parameter to FileInputStream 's constructors?
Bin Zhao
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FilterInputStream