FileDocCategorySizeDatePackage
CompressingOutputStream.javaAPI DocExample947Thu Nov 08 00:23:26 GMT 2001com.ora.rmibook.chapter2.sockets

CompressingOutputStream

public class CompressingOutputStream extends OutputStream

Fields Summary
private OutputStream
_actualOutputStream
private GZIPOutputStream
_delegate
Constructors Summary
public CompressingOutputStream(OutputStream actualOutputStream)

        _actualOutputStream = actualOutputStream;
    
Methods Summary
public voidclose()

        if (null != _delegate) {
            _delegate.close();
        } else {
            _actualOutputStream.close();
        }
    
public voidflush()

        if (null != _delegate) {
            _delegate.finish();
        }
    
public voidwrite(int arg)

        if (null == _delegate) {
            _delegate = new  GZIPOutputStream(_actualOutputStream);
        }
        _delegate.write(arg);
        return;