Deciding what those bytes mean is completely up to the programmer and the code. However, there are certain extremely common data formats that can benefit from a solid implementation in the class library. For example, many integers passed as parts of network protocols are 32-bit big-endian integers.
Much of the text sent over the Web is either 7-bit ASCII, 8-bit Latin-1, or multibyte UTF-8. Many files transferred by FTP are stored in the ZIP format. Java provides a number of filter classes you can attach to raw streams to translate the raw bytes to and from these and other formats. The filters come in two versions:
- the filter streams, and
- the readers and writers.
The readers and writers handle the special case of text in a variety of encodings such as UTF-8 and ISO 8859-1. Filters are organized in a chain and each link in the chain receives data from the previous filter or stream and passes the data along to the next link in the chain.