Package java.util.zip

Examples of java.util.zip.InflaterInputStream


         else if (encoding.equalsIgnoreCase("deflate"))
         {
            if (log.isDebugEnabled())
               log.debug("Pushing inflater-input-stream");

            resp.inp_stream = new InflaterInputStream(resp.inp_stream);
         }
         else if (encoding.equalsIgnoreCase("compress"))
         {
            if (log.isDebugEnabled())
               log.debug("Pushing uncompress-input-stream");
View Full Code Here


            byte[] data = new byte[length - 1];
            if (dataStream.read(data) < length - 1) {
                throw new DataException("MCRegion file does not contain "
                        + x + "," + z + " in full");
            }
            return new InflaterInputStream(new ByteArrayInputStream(data));
        } else {
            throw new DataException("MCRegion chunk at "
                    + x + "," + z + " has an unsupported version of " + version);
        }
    }
View Full Code Here

      is = responseBodyStream;
    } else if (encoding.equalsIgnoreCase("gzip")) {
      is = new GZIPInputStream(responseBodyStream);
    } else if (encoding.equalsIgnoreCase("deflate")) {
      Inflater inflater = new Inflater(true);
      is = new InflaterInputStream(responseBodyStream, inflater);
    }

    byte[] body = IOUtils.toByteArray(is);
    return new HttpResponseBuilder()
        .setHttpStatusCode(responseCode)
View Full Code Here

        {
            case ZipEntry.STORED:
                return bis;
            case ZipEntry.DEFLATED:
                bis.addDummy();
                return new InflaterInputStream( bis, new Inflater( true ) )
                {
                    public void close()
                        throws IOException
                    {
                        super.close();
View Full Code Here

        switch (ze.getMethod()) {
            case ZipEntry.STORED:
                return bis;
            case ZipEntry.DEFLATED:
                bis.addDummy();
                return new InflaterInputStream(bis, new Inflater(true));
            default:
                throw new ZipException("Found unsupported compression method "
                                       + ze.getMethod());
        }
    }
View Full Code Here

  @SuppressWarnings("unchecked")
  private void readObject(ObjectInputStream ois)
    throws IOException, ClassNotFoundException {
    ois.defaultReadObject();
    ObjectInputStream partInfoReader =
      new ObjectInputStream(new InflaterInputStream(ois));
    partitions = (List<PartInfo>)partInfoReader.readObject();
  }
View Full Code Here

    public Object unmarshal(Exchange exchange, InputStream stream)
        throws Exception {

        InputStream is = ExchangeHelper.getMandatoryInBody(exchange, InputStream.class);
        InflaterInputStream unzipInput = new InflaterInputStream(is);
       
        // Create an expandable byte array to hold the inflated data
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        IOConverter.copy(unzipInput, bos);
        return bos.toByteArray();
View Full Code Here

      switch(ContentEncoding.valueOf(encodings[n].toUpperCase().replaceAll("-", ""))) {
        case GZIP:
        case XGZIP:
          in = new GZIPInputStream(in); break;
        case DEFLATE:
          in = new InflaterInputStream(in); break;
      }
    }
    return in;
  }
View Full Code Here

        }
    }

    public Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
        InputStream is = exchange.getIn().getMandatoryBody(InputStream.class);
        InflaterInputStream unzipInput = new InflaterInputStream(is);
       
        // Create an expandable byte array to hold the inflated data
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        try {
            IOHelper.copy(unzipInput, bos);
View Full Code Here

            if (data == null) {
                data = new ByteSequence(new byte[] {}, 0, 0);
            }
            InputStream is = new ByteArrayInputStream(data);
            if (isCompressed()) {
                is = new InflaterInputStream(is);
                is = new BufferedInputStream(is);
            }
            this.dataIn = new DataInputStream(is);
        }
    }
View Full Code Here

TOP

Related Classes of java.util.zip.InflaterInputStream

Copyright © 2018 www.massapicom. 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.