File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes BufferedInputStream vs BufferedReader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "BufferedInputStream vs BufferedReader" Watch "BufferedInputStream vs BufferedReader" New topic
Author

BufferedInputStream vs BufferedReader

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

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 .

Save India From Corruption - Anna Hazare.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: BufferedInputStream vs BufferedReader