java.util.zip.Deflater (JDK 1.1)
This class implements the general ZLIB data compression algorithm used by the gzip and PKZip compression programs. The constants defined by this class are used to specify the compression strategy to be used and the compression speed/strength trade-off level to be used. If you set the nowrap argument to the constructor to true, then the ZLIB header and checksum data are omitted from the compressed output, which is the format that both gzip and PKZip use.
The important methods of this class are setInput(), which specifies input data to be compressed, and deflate(), which compresses the data and returns the compressed output. The remaining methods exist so that Deflater can be used for stream-based compression, as it is in higher-level classes such as GZIPOutputStream and ZipOutputStream. These stream classes are sufficient in most cases. Most applications do not need to use Deflater directly.
The Inflater class uncompresses data compressed with a Deflater object.
public classDeflaterextends Object { //Public ConstructorspublicDeflater(intlevel, booleannowrap); publicDeflater(intlevel); publicDeflater(); //Constantspublic static final intBEST_COMPRESSION; public static final intBEST_SPEED; public static final intDEFAULT_COMPRESSION; public static final intDEFAULT_STRATEGY; public static final intDEFLATED; public static final intFILTERED; public static final intHUFFMAN_ONLY; public static final intNO_COMPRESSION; //Public Instance Methodspublic synchronized native intdeflate(byte[]b, intoff, intlen); public intdeflate(byte[]b); public synchronized native voidend(); public synchronized voidfinish(); public synchronized booleanfinished(); public synchronized native intgetAdler(); public synchronized native intgetTotalIn(); public synchronized native intgetTotalOut(); public booleanneedsInput(); public synchronized native voidreset(); public synchronized native voidsetDictionary(byte[]b, intoff, intlen); public voidsetDictionary(byte[]b); public synchronized voidsetInput(byte[]b, intoff, intlen); public voidsetInput(byte[]b); public synchronized voidsetLevel(intLevel); public synchronized voidsetStrategy(intstrategy); //Protected Instance Methodsprotected voidfinalize(); //Overrides Object}
Passed To:
DeflaterOutputStream()
Type Of:
DeflaterOutputStream.def