Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6361041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:43:31+00:00 2026-05-24T23:43:31+00:00

What is the purpose of the java.io.Filter* types? i.e. FilterInputStream , FilterReader Isn’t it

  • 0

What is the purpose of the java.io.Filter* types? i.e. FilterInputStream, FilterReader

Isn’t it possible to add any filtering logic to a concrete stream class like FileInputStream by simply overriding particular methods and making calls to super()? i.e. super.read()

As far as I can tell, the only facility the filter types provide are perceptive at best — that is, they document (at a glance) the fact that all the developer really needed was a way to apply some additional logic (filtering) to an already existing stream implementation.

What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:43:32+00:00Added an answer on May 24, 2026 at 11:43 pm

    This is a Decorator Pattern, which then you can use to filter anything that extends an input stream. Meaning that you have high flexibility for it’s use.

    If you extend an input stream, then whenever you want to filter something you need to extend that type of input stream. So if you want to filter every type of input stream you’ll need a filter extension class for every type of input stream. Using the decorator pattern you only need one implementation that accepts an Input Stream and you can filter them all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: What is the purpose of the expression “new String(…)” in Java? I've
Possible Duplicate: What is the purpose of the expression “new String(…)” in Java? When
Possible Duplicate: What is the purpose of the expression “new String(…)” in Java? What's
I just noticed that java.util.Observable is a concrete class. Since the purpose of Observable
What is the purpose of these java.lang.annotation imports in this code? Why are they
What is the purpose of annotations in Java? I have this fuzzy idea of
I'm still not clear on the purpose of annotations in Java. Initially I thought
I am aware that the purpose of volatile variables in Java is that writes
I want to create a purpose built device capable of running a java vm
I am working on a module whose purpose is to process Java exceptions and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.