Java Gunzip Byte Array gunzip(byte[] data)

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

Description

gunzip

License

Apache License

Declaration

public static byte[] gunzip(byte[] data) throws IOException 

Method Source Code


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

import com.google.common.io.ByteStreams;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.GZIPInputStream;

public class Main {
    public static byte[] gunzip(byte[] data) throws IOException {
        InputStream in = new GZIPInputStream(new ByteArrayInputStream(data));
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ByteStreams.copy(in, out);/*  w  ww  .j av  a2s.  c o  m*/
        return out.toByteArray();
    }
}

Related

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