Java Gunzip Byte Array gunzip(byte[] in)

Here you can find the source of gunzip(byte[] in)

Description

gunzip

License

LGPL

Declaration

public static String gunzip(byte[] in) throws IOException 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.io.BufferedReader;
import java.io.ByteArrayInputStream;

import java.io.IOException;

import java.io.InputStreamReader;

import java.util.zip.GZIPInputStream;

public class Main {
    public static String gunzip(byte[] in) throws IOException {
        GZIPInputStream gis = new GZIPInputStream(new ByteArrayInputStream(in));
        BufferedReader bf = new BufferedReader(new InputStreamReader(gis, "UTF-8"));
        String outStr = "";
        String line;//ww w. j  a  va2s  . c o  m
        while ((line = bf.readLine()) != null)
            outStr += line;

        return outStr;
    }
}

Related

  1. gunzip(byte[] bytes)
  2. gunzip(byte[] contentBytes)
  3. gunzip(byte[] data)
  4. gunzip(byte[] data)
  5. gunzip(byte[] data)
  6. gunzip(final byte[] b, final Class c)
  7. gunzip(final byte[] pInput)