This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes IO Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "IO" Watch "IO" New topic
Author

IO

Richard Wilson
Ranch Hand

Joined: Jan 12, 2002
Posts: 57
Which can be used to read ascii codes from a file?
InputStream or InputStreamReader?


Richard Wilson
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
When you're dealing with raw bytes, use Streams; when you're dealing with character data, use Readers.
In this case you'd want to use an InputStreamReader.


Rob
SCJP 1.4
Richard Wilson
Ranch Hand

Joined: Jan 12, 2002
Posts: 57
Hi,Rob,
can u tell me what's meaning of ascii code?
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
ASCII is a (by today's standards) old encoding scheme that maps number codes to alphanumeric symbols. There are 127 characters in the basic ASCII character set,including letters, numbers, and punctutation symbols from the Western English alphabet. ASCII isn't very useful in international settings since it's missing a lot of symbols that other languages use.
That's why java uses Unicode. Unicode is another type of encoding that can define up to 65,535 different characters, and is therefore able to handle most of the characters in every language on the planet.
See also here:
http://www.mindprod.com/gloss.html
scroll down and look for ASCII.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: IO