package org.jboss.test.invokers.ejb;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
class CompressionSocket extends Socket
{
private InputStream in;
private OutputStream out;
public CompressionSocket()
{
super();
}
public CompressionSocket(String host, int port) throws IOException
{
super(host, port);
}
public InputStream getInputStream() throws IOException
{
if (in == null)
{
in = new CompressionInputStream(super.getInputStream());
}
return in;
}
public OutputStream getOutputStream() throws IOException
{
if (out == null)
{
out = new CompressionOutputStream(super.getOutputStream());
}
return out;
}
public synchronized void close() throws IOException
{
OutputStream o = getOutputStream();
o.flush();
super.close();
}
}