Java BufferedInputStream Create getInputStream(byte[] data)

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

Description

Returns input stream to decompress the data as read.

License

Open Source License

Parameter

Parameter Description
data the compressed bytes

Exception

Parameter Description
IOException an exception

Return

InputStream, never null.

Declaration

public static InputStream getInputStream(byte[] data) throws IOException 

Method Source Code


//package com.java2s;
import java.io.ByteArrayInputStream;

import java.io.IOException;
import java.io.InputStream;

import java.util.zip.GZIPInputStream;

public class Main {
    /**/*from  w w w .  jav  a  2 s.co m*/
     * Returns input stream to decompress the data as read.
     *
     * @param data the compressed bytes
     * @return InputStream, never null.
     * @throws IOException
     */
    public static InputStream getInputStream(byte[] data) throws IOException {
        ByteArrayInputStream bis = new ByteArrayInputStream(data);
        GZIPInputStream retval = new GZIPInputStream(bis);
        return retval;
    }
}

Related

  1. getInputStream(byte[] signature)
  2. getInputStream(byte[]... data)
  3. getInputStream(File file)
  4. getInputStream(final String path)