Compressing Data When Using Sockets

   

By default, the data that is sent through or over a socket is just raw data. You send the data by acquiring either the input or output stream on the socket and using it or wrapping it in another type of stream such as a BufferedReader or PrinterWriter.

The term network traffic represents all the data that is being sent over the network. Some of this data is used for control, such as verifying that a host is alive . Most of the data is just application data that is being used by all the network applications that are communicating with each other. The amount of network traffic is always a concern for network administrators and also programmers trying to do performance tuning on an application.

Unfortunately, the core Java language provides no behavior to compresses the data. However, you can use your own algorithm or a third-party algorithm to compress your application data before sending through one of the output streams and then uncompress it on the other side. This is not needed for small amounts of data, but if your application is sending large amounts of information back and forth between components , you might consider it.

   


Special Edition Using Java 2 Standard Edition
Special Edition Using Java 2, Standard Edition (Special Edition Using...)
ISBN: 0789724685
EAN: 2147483647
Year: 1999
Pages: 353

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net