Package java.util.zip

Examples of java.util.zip.Inflater.reset()


      finally
      {
        //Reset and put back
        if(decompressor != null)
        {
          decompressor.reset();
          TransientHolder<Inflater> th = TransientHolder.newTransientHolder(decompressor);
          sessionMap.put("PAGE_STATE_INFLATER", th);
        }
      }
    }
View Full Code Here


    }

    public int uncompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset) throws IOException
    {
        Inflater inf = inflater.get();
        inf.reset();
        inf.setInput(input, inputOffset, inputLength);
        if (inf.needsInput())
            return 0;

        // We assume output is big enough
View Full Code Here

                    int original_size=hdr.original_size;
                    byte[] uncompressed_payload=new byte[original_size];
                    Inflater inflater=null;
                    try {
                        inflater=inflater_pool.take();
                        inflater.reset();
                        inflater.setInput(compressed_payload, msg.getOffset(), msg.getLength());
                        try {
                            inflater.inflate(uncompressed_payload);
                            if(log.isTraceEnabled())
                                log.trace("uncompressed " + compressed_payload.length + " bytes to " + original_size +
View Full Code Here

                    int original_size=hdr.original_size;
                    byte[] uncompressed_payload=new byte[original_size];
                    int tmp_index=getInflaterIndex();
                    Inflater inflater=inflater_pool[tmp_index];
                    synchronized(inflater) {
                        inflater.reset();
                        inflater.setInput(compressed_payload, msg.getOffset(), msg.getLength());
                        try {
                            inflater.inflate(uncompressed_payload);
                            if(log.isTraceEnabled())
                                log.trace("uncompressed " + compressed_payload.length + " bytes to " + original_size +
View Full Code Here

            crc32.reset();
            state.setInflater(inflater);
            state.setCrc32(crc32);
        } else if (state.getDecodeStatus() == DecodeStatus.DONE) {
            state.setDecodeStatus(DecodeStatus.INITIAL);
            inflater.reset();
            state.getCrc32().reset();
        }
        if (!parseHeader(buffer, state)) {
            return false;
        }
View Full Code Here

                addBytesWritten(n);

                if (inf.finished() || inf.needsDictionary()) {
                    int remainder = inf.getRemaining();
                    changeBuffer(remainder);
                    inf.reset();
                    inf.setInput(mBuff, 0, remainder);
                } else if (inf.needsInput()) {
                    fill(inf);
                }
            }
View Full Code Here

        // construct the inflater object or reuse an existing one
        if (inflater == null)
            inflaterRef = new SoftReference<Inflater>(inflater = new Inflater(true));

        inflater.reset();
        inflater.setInput(src);
        try {
            return inflater.inflate(dest);
        } catch (DataFormatException ex) {
            return -1;
View Full Code Here

                    int original_size=hdr.original_size;
                    byte[] uncompressed_payload=new byte[original_size];
                    int tmp_index=getInflaterIndex();
                    Inflater inflater=inflater_pool[tmp_index];
                    synchronized(inflater) {
                        inflater.reset();
                        inflater.setInput(compressed_payload, msg.getOffset(), msg.getLength());
                        try {
                            inflater.inflate(uncompressed_payload);
                            if(log.isTraceEnabled())
                                log.trace("uncompressed " + compressed_payload.length + " bytes to " + original_size +
View Full Code Here

   * thread-local inflater, just reset : this should be only used for short
   * individual chunks compression
   */
  public static Inflater getInflater() {
    Inflater inflater = inflaterProvider.get();
    inflater.reset();
    return inflater;
  }

  /**
   * thread-local deflater, just reset : this should be only used for short
View Full Code Here

/* 192 */       inflater.finished();
/*     */
/* 194 */       byte[] out = new byte[uncompressedSize];
/* 195 */       inflater.inflate(out);
/*     */
/* 197 */       inflater.reset();
/* 198 */       return out;
/*     */     }
/*     */     catch (DataFormatException e)
/*     */     {
/*     */     }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.