Java Decompress Byte Array decompress(byte[] zipByte)

Here you can find the source of decompress(byte[] zipByte)

Description

decompress

License

Open Source License

Declaration

public static byte[] decompress(byte[] zipByte) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;
import java.util.zip.*;

public class Main {
    public static byte[] decompress(byte[] zipByte) throws IOException {
        ByteArrayOutputStream aos = new ByteArrayOutputStream();
        Inflater inflater = new Inflater();
        inflater.setInput(zipByte);//from   w w  w  .  j  av  a 2s.c om
        byte[] buff = new byte[1024 * 1000];
        int byteNum = 0;
        while (!inflater.finished()) {
            try {
                byteNum = inflater.inflate(buff);
                aos.write(buff, 0, byteNum);
            } catch (DataFormatException e) {
                e.printStackTrace();
            }
        }
        return aos.toByteArray();
    }
}

Related

  1. decompress(byte[] input)
  2. decompress(byte[] source)
  3. decompress(byte[] source)
  4. decompress(byte[] src, Inflater decompresser, int compressCycleSize)
  5. decompress(byte[] str)
  6. decompress(final byte[] compressed)
  7. decompress(final DataInputStream input, final byte[] result, int offset, int length)
  8. decompressAndB64DecodeUTF8Bytes(byte[] b64EncodedCompressedBytes)
  9. decompressByte(byte[] decompress)