inflater.reset(); inflater.setInput(compressed_payload, msg.getOffset(), msg.getLength()); try { inflater.inflate(uncompressed_payload); if(trace) log.trace("uncompressed " + compressed_payload.length + " bytes to " + original_size + " bytes"); msg.setBuffer(uncompressed_payload); } catch(DataFormatException e) { if(log.isErrorEnabled()) log.error("exception on uncompression: " + e);
synchronized(inflater_mutex) { inflater.reset(); inflater.setInput(compressed_payload, msg.getOffset(), msg.getLength()); try { inflater.inflate(uncompressed_payload); if(trace) log.trace("uncompressed " + compressed_payload.length + " bytes to " + original_size + " bytes"); msg.setBuffer(uncompressed_payload); } catch(DataFormatException e) { if(log.isErrorEnabled()) log.error("exception on uncompression", e); }
    public void up(Event evt) {        if(evt.getType() == Event.MSG) {            Message msg=(Message)evt.getArg();            CompressHeader hdr=(CompressHeader)msg.removeHeader(name);            if(hdr != null) {                byte[] compressed_payload=msg.getRawBuffer();                if(compressed_payload != null && compressed_payload.length > 0) {                    int original_size=hdr.original_size;                    byte[] uncompressed_payload=new byte[original_size];                    inflater.reset();                    inflater.setInput(compressed_payload, msg.getOffset(), msg.getLength());                    try {                        inflater.inflate(uncompressed_payload);                        if(trace)                            log.trace("uncompressed " + compressed_payload.length + " bytes to " +                                    original_size + " bytes");                        msg.setBuffer(uncompressed_payload);                    }                    catch(DataFormatException e) {                        if(log.isErrorEnabled()) log.error("exception on uncompression: " + e);                    }                }            }        }        passUp(evt);    }