Here you can find the source of getInputStream(byte[] data)
Parameter | Description |
---|---|
data | the compressed bytes |
Parameter | Description |
---|---|
IOException | an exception |
public static InputStream getInputStream(byte[] data) throws IOException
//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; } }