This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between reader and stream

 
kundan varma
Ranch Hand
Posts: 323
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI All
What is the difference between reader and stream of java.io ?

Thanks
kundan
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
readers work on Strings, streams on anything.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or more generally: Readers and Writers work with character data and have a notion of a character encoding. The bytes in a file may not match exactly what you get back from a Reader, depending on the active character encoding. If you're working with non-ASCII text, you need to use these or you'll get wrong answers.

Streams, on the other hand, return you byte-for-byte what's in the file, and so are good for binary data with no encoding or translation.
 
kundan varma
Ranch Hand
Posts: 323
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Ernest
THanks your reply really clears my concept.
THanks again, do you have your book available in INdian edition???

kundan
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic