edu.emory.mathcs.util.net.compressed
Class CompressedServerSocketWrapper

java.lang.Object
  extended byjava.net.ServerSocket
      extended byedu.emory.mathcs.util.net.ServerSocketWrapper
          extended byedu.emory.mathcs.util.net.compressed.CompressedServerSocketWrapper
All Implemented Interfaces:
DecoratingServerSocket

public class CompressedServerSocketWrapper
extends ServerSocketWrapper
implements DecoratingServerSocket

Server socket wrapper that enables data compression on top of connections accepted by a specified server socket. The accept method of this class delegates to the underlying server socket and wraps accepted sockets into CompressedSocketWrapper.

Author:
Dawid Kurzyniec
See Also:
CompressedSocketWrapper, CompressedOutputStream

Field Summary
protected  int bufSize
           
 
Fields inherited from class edu.emory.mathcs.util.net.ServerSocketWrapper
delegate
 
Constructor Summary
CompressedServerSocketWrapper(java.net.ServerSocket delegate, int bufSize)
           
 
Method Summary
 java.net.ServerSocket getBaseSocket()
          Returns base server socket wrapped by this socket.
protected  java.net.Socket wrapAcceptedSocket(java.net.Socket accepted)
           
 
Methods inherited from class edu.emory.mathcs.util.net.ServerSocketWrapper
accept, close, equals, getChannel, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, hashCode, isBound, isClosed, setReceiveBufferSize, setReuseAddress, setSoTimeout, toString
 
Methods inherited from class java.net.ServerSocket
bind, bind, implAccept, setSocketFactory
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

bufSize

protected final int bufSize
Constructor Detail

CompressedServerSocketWrapper

public CompressedServerSocketWrapper(java.net.ServerSocket delegate,
                                     int bufSize)
                              throws java.io.IOException
Method Detail

getBaseSocket

public java.net.ServerSocket getBaseSocket()
Description copied from interface: DecoratingServerSocket
Returns base server socket wrapped by this socket.

Specified by:
getBaseSocket in interface DecoratingServerSocket
Returns:
base server socket wrapped by this socket

wrapAcceptedSocket

protected java.net.Socket wrapAcceptedSocket(java.net.Socket accepted)
                                      throws java.io.IOException
Specified by:
wrapAcceptedSocket in class ServerSocketWrapper
Throws:
java.io.IOException