Intent: Separate different aspects of a communications protocol into layers.
Example:
To request a web page, a browser forms a request in HTTP (Hyper-Text Transfer Protocol) format. This request is passed to the TCP layer, which breaks it up into packets (if necessary). This is in turn passed to the IP and media layers, which take care of further translation necessary to put the request on the network.
On the server side, the media layer receives the signals, passes them to the IP layer as IP packets, which passes them to the TCP layer to be reassembled into a stream of bytes, which is then passed to the web server process to be interpreted as an HTTP request. Note that each layer on the receiving side undoes whatever was done by the corresponding layer on the sending side.
Related Patterns: AdapterPattern
Cf: java.io "pipes"
BufferedReader? r = new BufferedReader?(new InputStreamReader?(new GUnzipInputStream( new FileInputStream?(file))));