Examples of InflaterInputStream


Examples of java.util.zip.InflaterInputStream

      // check for deflate and gzip compression
      Header h = m.getResponseHeader("content-encoding");
      String encoding = (h == null) ? null : h.getValue();

      if (encoding != null && encoding.equals("deflate")) {
        InputStream is = new BufferedInputStream(new InflaterInputStream(m.getResponseAsStream()), 10000);
        nbytes = IO.appendToFile(is, file.getPath());

      } else if (encoding != null && encoding.equals("gzip")) {
        InputStream is = new BufferedInputStream(new GZIPInputStream(m.getResponseAsStream()), 10000);
        nbytes = IO.appendToFile(is, file.getPath());
View Full Code Here

Examples of java.util.zip.InflaterInputStream

      if ( contentEncoding != null )
      {
        if ( contentEncoding.equalsIgnoreCase( "gzip" ) )
          return new GZIPInputStream( is );
        else if ( contentEncoding.equalsIgnoreCase( "deflate" ) )
          return new InflaterInputStream( is );
      }
    }
    return is;
  }
View Full Code Here

Examples of java.util.zip.InflaterInputStream

  static public void uncompressFile( String filenameIn, String filenameOut, boolean inflate) throws IOException {
    long lenIn = new File(filenameIn).length();
    if (debug) System.out.println("read compressed file= "+filenameIn+ " len = "+lenIn);

    FileInputStream fin = new FileInputStream(filenameIn);
    InputStream in = (inflate) ? new InflaterInputStream(fin) : new GZIPInputStream(fin);
    in = new BufferedInputStream(in, 1000);

    FileOutputStream fout = new FileOutputStream(filenameOut);
    OutputStream out = new BufferedOutputStream(fout, 1000);
View Full Code Here

Examples of java.util.zip.InflaterInputStream

  }

  // test InflaterInputStream
  static public void inflateRandom( String filename, boolean buffer) throws IOException {
    FileInputStream fin = new FileInputStream(filename);
    InputStream in = new InflaterInputStream(fin);
    if (buffer)
      in = new BufferedInputStream(in, 1000);
    DataInputStream din = new DataInputStream(in);

    long start = System.currentTimeMillis();
View Full Code Here

Examples of java.util.zip.InflaterInputStream

      byte[] content = output.toByteArray();
      input.close();
      output.close();

      ByteArrayInputStream inStream = new ByteArrayInputStream(content);
      InflaterInputStream szlib = new InflaterInputStream(inStream, new Inflater());
      InputSerializer inputSerializer = new InputSerializer(szlib);
      inputSerializer.setProtocolVersion(protocolVersion);

      RPObject object = (RPObject) inputSerializer.readObject(new RPObject());
View Full Code Here

Examples of java.util.zip.InflaterInputStream

      byte[] content = output.toByteArray();
      input.close();
      output.close();

      ByteArrayInputStream inStream = new ByteArrayInputStream(content);
      InflaterInputStream szlib = new InflaterInputStream(inStream, new Inflater());
      InputSerializer inputSerializer = new InputSerializer(szlib);

      int protocolVersion = NetConst.FIRST_VERSION_WITH_MULTI_VERSION_SUPPORT - 1;
      Object temp = resultSet.getObject("protocol_version");
      if (temp != null) {
View Full Code Here

Examples of java.util.zip.InflaterInputStream

   {
      if (compressedContent == null) return null;
     
      try
      {
         ObjectInputStream in = new ObjectInputStream(new InflaterInputStream(new ByteArrayInputStream(compressedContent)));
        
         Object object = in.readObject();
         in.close();
         return object;
      }
View Full Code Here

Examples of java.util.zip.InflaterInputStream

            else
                result = getBufferedImageFactory(params).getColorBufferedImage(
                        width, height, hasAlpha);

            ByteArrayInputStream bais = new ByteArrayInputStream(compressed);
            InflaterInputStream iis = new InflaterInputStream(bais);

            ScanExpediter scanExpediter;

            if (pngChunkIHDR.interlaceMethod == 0)
                scanExpediter = new ScanExpediterSimple(width, height, iis,
View Full Code Here

Examples of java.util.zip.InflaterInputStream

    PdfDictionary parameters
    )
  {
    try
    {
      InflaterInputStream inputFilter = new InflaterInputStream(
        new ByteArrayInputStream(data, offset, length)
        );
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      transform(inputFilter, outputStream);
      return decodePredictor(outputStream.toByteArray(), parameters);
View Full Code Here

Examples of java.util.zip.InflaterInputStream

            f = storage.openInputStreamElement(infilename);

            switch (compressionType) {

                case COMPRESSION_ZIP :
                    f = new InflaterInputStream(f, new Inflater());
                    break;

                case COMPRESSION_GZIP :
                    f = new GZIPInputStream(f, b.length);
                    break;
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.