Code example for Deflater

Methods: deflate

0
		dout.writeShort(MAGIC);
		dout.flush();
	} 
	 
	private void deflate() throws IOException { 
        int len = def.deflate(buf, 0, buf.length);
        if (len > 0)
            dout.write(buf, 0, len);
    } 
	 
	@Override 
	public void write(byte[] b, int off, int len) throws IOException {
		if (closed)
			throw new IOException("End of stream");
		 
		if (def.finished()) {
			dout.writeShort(NEXT);
            def.reset();
		}