java.io package contains many useful
filter stream classes. The
classes buffer reads and writes by first
putting data into a buffer (an internal array of bytes). Thus, an
application can read or write bytes to the stream without necessarily
calling the underlying native methods. The data is read from or
written into the buffer in blocks; subsequent accesses go straight to
the buffer. This improves performance in many situations. Buffered
input streams also allow the reader to back up and reread data.
instances of, allows very simple printing of primitive values,
objects, and string literals. It uses the platform’s default
character encoding to convert characters into bytes. This class traps
IOExceptions and is primarily intended for
System.err are the most popular examples of the
PrintStream class, but you can connect a
PrintStream filter to other output streams as
well. For example, you can chain a
FileOutputStream to easily write text into a
class has a one-byte pushback buffer so a
program can “unread” the last character read. The next
time data is read from the stream, the unread character is reread.
DataOutputStream classes read and write primitive Java data types and strings in a machine-independent way. (Big-endian for integer types, ...