Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

BufferedInputStream vs BufferedReader

 
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody please let me know when to use the BufferedReader and BufferedInputStream .
Because using both i can able to read the data from my Text Input File .

Bartenders please bare this time if this is a question not to posted .
so please share your ideas .
Thanks in advance .
 
Sheriff
Posts: 22755
130
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ravi Kiran V wrote:Can anybody please let me know when to use the BufferedReader and BufferedInputStream .
Because using both i can able to read the data from my Text Input File .


InputStream and all of its direct and indirect subclasses should be used for binary files, as it reads bytes. It can be used for text files if and only if the file's encoding uses exactly one byte for every character, like ASCII.
Reader and all of its direct and indirect subclasses should be used for text files, as it reads chars. It should never ever be used for binary files.

InputStream can also be used if you do not need to inspect the contents, like in copying files.

Bartenders please bare this time if this is a question not to posted .


Why should it not be posted? You didn't ask this question anywhere else (that I am aware of). The only reason could be that you could have found the answer by searching first.
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic