Package java.util.zip

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


                byte[] compressed_payload=new byte[length];
                int compressed_size;
                int tmp_index=getDeflaterIndex();
                Deflater deflater=deflater_pool[tmp_index]; // must be guaranteed to be non-null !
                synchronized(deflater) {
                    deflater.reset();
                    deflater.setInput(payload, msg.getOffset(), length);
                    deflater.finish();
                    deflater.deflate(compressed_payload);
                    compressed_size=deflater.getTotalOut();
                }
View Full Code Here


    out.resetCRC32();
    otp.setOffset(out.length());
    out.writeHeader(otp, ldr.getSize());

    deflater.reset();
    DeflaterOutputStream dst = new DeflaterOutputStream(out, deflater);
    ldr.copyTo(dst);
    dst.finish();
  }
View Full Code Here

    TemporaryBuffer.Heap delta = delta(otp);
    out.writeHeader(otp, delta.length());

    Deflater deflater = deflater();
    deflater.reset();
    DeflaterOutputStream dst = new DeflaterOutputStream(out, deflater);
    delta.writeTo(dst, null);
    dst.finish();
    typeStats.cntDeltas++;
    typeStats.deltaBytes += out.length() - otp.getOffset();
View Full Code Here

        int compressedDataLength = compresser.deflate(buffer);
        byte[] output = new byte[compressedDataLength];
        for (int i=0; i<compressedDataLength; i++) {
            output[i] = buffer[i];
        }
        compresser.reset();
        return output;
    }

    protected String base64Encode(byte[] data) {
        String encodedString = Base64.encodeBase64String(data);
View Full Code Here

                byte[] compressed_payload=new byte[length];
                int compressed_size;
                int tmp_index=getDeflaterIndex();
                Deflater deflater=deflater_pool[tmp_index]; // must be guaranteed to be non-null !
                synchronized(deflater) {
                    deflater.reset();
                    deflater.setInput(payload, msg.getOffset(), length);
                    deflater.finish();
                    deflater.deflate(compressed_payload);
                    compressed_size=deflater.getTotalOut();
                }
View Full Code Here

    out.resetCRC32();
    otp.setOffset(out.length());
    out.writeHeader(otp, ldr.getSize());

    deflater.reset();
    DeflaterOutputStream dst = new DeflaterOutputStream(out, deflater);
    ldr.copyTo(dst);
    dst.finish();
  }
View Full Code Here

    TemporaryBuffer.Heap delta = delta(otp);
    out.writeHeader(otp, delta.length());

    Deflater deflater = deflater();
    deflater.reset();
    DeflaterOutputStream dst = new DeflaterOutputStream(out, deflater);
    delta.writeTo(dst, null);
    dst.finish();
    typeStats.cntDeltas++;
    typeStats.deltaBytes += out.length() - otp.getOffset();
View Full Code Here

   * thread-local deflater, just reset : this should be only used for short
   * individual chunks decompression
   */
  public static Deflater getDeflater() {
    Deflater deflater = deflaterProvider.get();
    deflater.reset();
    return deflater;
  }

  public static PngChunk cloneForWrite(PngChunk chunk, ImageInfo imgInfo) {
    PngChunk c = chunk.cloneForWrite(imgInfo);
View Full Code Here

    crc32.reset();
    otp.setOffset(out.length());
    out.writeHeader(otp, ldr.getSize());

    deflater.reset();
    DeflaterOutputStream dst = new DeflaterOutputStream(out, deflater);
    ldr.copyTo(dst);
    dst.finish();
  }
View Full Code Here

    TemporaryBuffer.Heap delta = delta(otp);
    out.writeHeader(otp, delta.length());

    Deflater deflater = deflater();
    deflater.reset();
    DeflaterOutputStream dst = new DeflaterOutputStream(out, deflater);
    delta.writeTo(dst, null);
    dst.finish();
    typeStats.cntDeltas++;
    typeStats.deltaBytes += out.length() - otp.getOffset();
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.