FileDocCategorySizeDatePackage
CodecOutputStream.javaAPI DocExample758Thu Mar 30 15:21:48 BST 2000tuning.distrib.rmi

CodecOutputStream

public class CodecOutputStream extends FilterOutputStream

Fields Summary
Deflater
compressor
Constructors Summary
public CodecOutputStream(OutputStream out)

    super(out);
    compressor = new Deflater(Deflater.BEST_SPEED);
  
Methods Summary
public voidwrite(int x)

    throw new IOException("CodeOutputStream.write(int) unsuppported");
  
public voidwrite(byte[] b, int off, int len)

    int newlen = compressor.deflate(b, off, len);
    out.write(len);
    out.write(newlen);
System.out.println("Writing " + newlen);
    out.write(b, off, newlen);
    out.flush();
System.out.println("Flushed");