Examples of inflate()


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

    int offset = 0;
    int limit = nx * ny + nx;

    while (inflater.getRemaining() > 0) {
      try {
        resultLength = inflater.inflate(uncomp, offset, 4000);
      }
      catch (DataFormatException ex) {
        System.out.println("ERROR on inflation " + ex.getMessage());
        ex.printStackTrace();
        throw new IOException(ex.getMessage());
View Full Code Here

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

    inf.setInput(b, (int) hoff, numin - 4);
    int limit = 20000;

    while (inf.getRemaining() > 0) {
      try {
        resultLength = inf.inflate(uncomp, result, 4000);
      }
      catch (DataFormatException ex) {
        System.out.println("ERROR on inflation " + ex.getMessage());
        ex.printStackTrace();
        throw new IOException(ex.getMessage());
View Full Code Here

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

    inflater.setInput(in.array(), in.arrayOffset() + in.position(),
                      in.remaining());
    while (!(inflater.finished() || inflater.needsDictionary() ||
             inflater.needsInput())) {
      try {
        int count = inflater.inflate(out.array(),
                                     out.arrayOffset() + out.position(),
                                     out.remaining());
        out.position(count + out.position());
      } catch (DataFormatException dfe) {
        throw new IOException("Bad compression data", dfe);
View Full Code Here

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

        inflater.setInput(contents.array(), 0, contents.limit());
        byte[] buf = new byte[4096];
        ByteArrayOutputStream baos = new ByteArrayOutputStream(contents.limit());
        try {
          while (! inflater.finished()) {
            int inflated = inflater.inflate(buf, 0, buf.length);
            baos.write(buf, 0, inflated);
          }
        } catch (Exception e) {
          log.severe("DB| inflation error: "+e.getMessage());
          log.log(Level.FINE, "details: ", e);
View Full Code Here

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

            Inflater decompressor = new Inflater();
            byte[] uncompressed = new byte[zipsrc.length * 5];

            decompressor.setInput(zipsrc);

            int totalOut = decompressor.inflate(uncompressed);
            byte[] out = new byte[totalOut];

            System.arraycopy(uncompressed, 0, out, 0, totalOut);
            decompressor.end();

View Full Code Here

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

                    Inflater inflater=inflater_pool[tmp_index];
                    synchronized(inflater) {
                        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 (deflater #" + tmp_index + ")");
                            msg.setBuffer(uncompressed_payload);
                        }
View Full Code Here

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

    int olen = 0;
    Inflater decompresser = new Inflater();
    byte output[] = new byte[len];
    decompresser.setInput(input);
    try {
      olen = decompresser.inflate(output);
    } catch(java.util.zip.DataFormatException e) {
    }
    decompresser.end();
    if(len != olen) return new byte[0];
    return output;
View Full Code Here

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

        // Gzipped
        Inflater i = new Inflater();
        i.setInput(data, offset, length);
        // We shouldn't ever need a 4096 bytes long ref!
        byte[] output = new byte[4096];
        length = i.inflate(output, 0, output.length);
        // Finished
        data = output;
        offset = 0;
        if(logMINOR)
          Logger.minor(PeerNode.class, "We have decompressed a "+length+" bytes big reference.");
View Full Code Here

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

        } else {
          if (data[0] == 0x78 /* 'x' */) {
            Inflater zlib = new Inflater();
            zlib.setInput(data, 0, compressedLen);
            byte[] result = new byte[actualLen * 3];
            int resultLen = zlib.inflate(result);
            zlib.end();
            data = result;
            dataOffset = 0;
            dataLen = resultLen;
          } else if (data[0] == 0x75 /* 'u' */) {
View Full Code Here

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

        // Decompress the data
        byte[] buf = new byte[1024];
        while (!decompressor.finished())
        {
            int count = decompressor.inflate(buf);
            bos.write(buf, 0, count);
        }
        bos.close();

        // Get the decompressed data
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.