This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

About java.io  RSS feed

 
Jack Lau
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anyone tell me what is mean by filtering in the java.io ?
(e.g if I use BufferedInputStream chain with FileInputStream) why is it
called filtering ? filter what ?
it just read data from a file and what is actually filtered even
BufferedInputStream is extends FilterInputStream !
 
john guthrie
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i wouldn't get wrapped up in the term "filter". what classes like BufferedInputStream are is actually "decorators" (see a patterns reference if you don't know about decorators).
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to take a look at the "Working with Filter Streams" section of the I/O lesson of Sun's Java Tutorial.
 
Jack Lau
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dirk Schreckmann:
You may want to take a look at the "Working with Filter Streams" section of the I/O lesson of Sun's Java Tutorial.

Is that mean filter something is to do some work just like buffering, converting data to another format, etc ?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first paragraph of the aforementioned reference should answer your question.
Some streams buffer the data, some count data as it goes by, and others convert data to another form.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!