Filing Representation & Filter

The writeUTF(String s) method writes two bytes of length information to the
output stream, followed by the modified UTF-8 representation of every character in the
string s. UTF-8 is a coding scheme that allows systems to operate with both ASCII and
Unicode. Most operating systems use ASCII. Java uses Unicode. The ASCII character set
is a subset of the Unicode character set
17.10 binary/IO
..........................

The initial bits of a UTF-8 character indicate whether a character is stored in one byte, two
bytes, or three bytes.
........................

Filter streams are streams that filter bytes for some purpose. The basic byte input stream
provides a read method that can be used only for reading bytes. If you want to read
integers, doubles, or strings, you need a filter class to wrap the byte input stream. Using a
filter class enables you to read integers, doubles, and strings instead of bytes and characters.
FilterInputStream and FilterOutputStream are the base classes for filtering
data. When you need to process primitive numeric types, use DataInputStream and
DataOutputStream to filter bytes.


Book Y Danial edition 10 java Progrmming I/O

0 comments:

Post a Comment

My Instagram