Examples of Inflater


Examples of java.util.zip.Inflater

        // Parse prior IDAT chunks
        InputStream seqStream =
            new SequenceInputStream(streamVec.elements());
        InputStream infStream =
            new InflaterInputStream(seqStream, new Inflater());
        dataStream = new DataInputStream(infStream);

        // Create an empty WritableRaster
        int depth = bitDepth;
        if ((colorType == PNG_COLOR_GRAY) &&
View Full Code Here

Examples of java.util.zip.Inflater

        case COMP_NONE:
        case COMP_PACKBITS:
            // Do nothing.
            break;
        case COMP_DEFLATE:
            inflater = new Inflater();
            break;
        case COMP_FAX_G3_1D:
        case COMP_FAX_G3_2D:
        case COMP_FAX_G4_2D:
            if(sampleSize != 1) {
View Full Code Here

Examples of java.util.zip.Inflater

            byte[] decodedMessage = Base64.decode(samlMessage);
            is = new ByteArrayInputStream(decodedMessage);
        } else {
            byte[] base64Decoded = Base64.decode(samlMessage);
            ByteArrayInputStream bais = new ByteArrayInputStream(base64Decoded);
            is = new InflaterInputStream(bais, new Inflater(true));
        }

        Document document = getDocument(is);
        String issuerEntityId;
        RequestAbstractType samlRequestMessage = null;
View Full Code Here

Examples of java.util.zip.Inflater

    return length > outSize;
  }

  @Override
  public void decompress(ByteBuffer in, ByteBuffer out) throws IOException {
    Inflater inflater = new Inflater(true);
    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);
      }
    }
    out.flip();
    inflater.end();
    in.position(in.limit());
  }
View Full Code Here

Examples of java.util.zip.Inflater

      data.mark();
      boolean is_gzip = (data.remaining() >= 2 && data.getShort() == GZIP_MAGIC);
      data.reset();

      if (is_gzip) {
        final Inflater inflater = new Inflater(true);
        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

            is = new BufferedInputStream(new GZIPInputStream(
                    conn.getInputStream()));
        } else if ("deflate".equals(contentEncoding)) {
            LOGGER.info("URL connection input stream is compressed using deflate");
            is = OWLOntologyDocumentSourceBase.wrap(new InflaterInputStream(
                    conn.getInputStream(), new Inflater(true)));
        } else {
            is = OWLOntologyDocumentSourceBase.wrap(conn.getInputStream());
        }
        return is;
    }
View Full Code Here

Examples of java.util.zip.Inflater

    }

    protected static byte[] decrypt(byte[] src) {
        try {
            byte[] zipsrc = CODEC.decode(src);
            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();

            return out;
        } catch (Exception e) {
            throw new FacesException("Error decode resource data", e);
        }
View Full Code Here

Examples of java.util.zip.Inflater

        for(int i=0; i < deflater_pool.length; i++) {
            deflater_pool[i]=new Deflater(compression_level);
        }
        inflater_pool=new Inflater[pool_size];
        for(int i=0; i < inflater_pool.length; i++) {
            inflater_pool[i]=new Inflater();
        }
    }
View Full Code Here

Examples of java.util.zip.Inflater

        for(int i=0; i < deflater_pool.length; i++) {
            Deflater deflater=deflater_pool[i];
            deflater.end();
        }
        for(int i=0; i < inflater_pool.length; i++) {
            Inflater inflater=inflater_pool[i];
            inflater.end();
        }
    }
View Full Code Here

Examples of java.util.zip.Inflater

                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];
                    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(trace)
                                log.trace("uncompressed " + compressed_payload.length + " bytes to " + original_size +
                                        " bytes (deflater #" + tmp_index + ")");
                            msg.setBuffer(uncompressed_payload);
                        }
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.