How can I convert ZipInputStream to InputStream?

newbie picture newbie · Oct 21, 2011 · Viewed 17.2k times · Source

I have code, where ZipInputSream is converted to byte[], but I don't know how I can convert that to inputstream.

private void convertStream(String encoding, ZipInputStream in) throws IOException,
        UnsupportedEncodingException
{
    final int BUFFER = 1;
    @SuppressWarnings("unused")
    int count = 0;
    byte data[] = new byte[BUFFER];
    while ((count = in.read(data, 0, BUFFER)) != -1) 
    {
       // How can I convert data to InputStream  here ?                    
    }
}

Answer

ExtremeCoder picture ExtremeCoder · Oct 21, 2011