A Reader is an input stream.
Readers and Writers deal with character streams.
These are abstract classes.
A program must use classes derived from them.
For example, a BufferedReader
is a Reader
.
Character streams are optimized for handling character data.
They also translate between the internal format used by Java
programs and an external format used for text files.
Inside a Java program character data is represented with
the 16-bit char
data type.
The characters of a String
use the same 16-bit code.
On a disk file, characters are represented in a format called UTF.
This format uses one to four bytes per character and is
intended to be a universal format—one format for all
text files in any language anywhere in the world.
UTF stands for "Unicode Transformation Format". Usually a UTF text file is identical to an ASCII text file. ASCII is the standard way to represent characters that most computers have used for the past thirty years. A file created with a text editor is usually an ASCII text file.
A UTF text file can include non-ASCII characters such as Cyrillic, Greek, and Asian characters. By reading and writing UTF files, Java programs can process text from any of the World's languages.
Could a Java program use the alphabet used on the island of Java?