Many protocols such as HTTP, POP, IMAP require that certain data (eg. image data) be encoded into a textual format before transmitting over the network, using BASE64 encoding. The sender must encode such data in BASE64, and the receiver must decode the data from BASE64 to original format.
See this for an example of how the client encodes data to be sent to the server, and decode data received from the server:-
http://www.javaranch.com/ubb/Forum8/HTML/000274.html [This message has been edited by Rahul Rathore (edited March 15, 2001).]