File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes I/O and Streams and the fly likes (FUNDAMENTALS)which use 8 bit US Ascii?? 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 "(FUNDAMENTALS)which use 8 bit US Ascii??" Watch "(FUNDAMENTALS)which use 8 bit US Ascii??" New topic

(FUNDAMENTALS)which use 8 bit US Ascii??

Ronnie Phelps
Ranch Hand

Joined: Mar 12, 2001
Posts: 329
I'm ashamed to say it but, I/O has allways been my weak side. Which I/O readers and writers read and write 8 bit US ASCII data to files???
Sam Moran
Ranch Hand

Joined: Sep 28, 2002
Posts: 86
I'm not an expert, but here is what I know from the work that I've been trying to do:
The basic ASCII Character set has 128 characters.
A byte, as defined by Java as a primitive data type, has a size of 8 bits, and it's range is from -128 to 127.
Most programs should use readers and writers to read and write textual information. The reason is that they can handle any character in the Unicode character set, whereas the byte streams are limited to ISO-Latin-1 8-bit bytes.
Based on the above statement from Sun itself, and based on what I have done if you want to write a simple text file then you want to use the Reader and Writer Objects. For true binary files you want to use InputStream and OutputStream.
I hope this helps!!

We make a living by what we get, we make a life by what we give!
I agree. Here's the link:
subject: (FUNDAMENTALS)which use 8 bit US Ascii??
It's not a secret anymore!