Win a copy of Rust Web Development this week in the Other Languages 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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: 22563
122
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic