|
if(data == null) return null;
MemoryStream ins = null;
MemoryStream outs = null;
InflaterInputStream iis = null;
try{
ins = new MemoryStream(data);
outs = new MemoryStream();
iis = new InflaterInputStream(ins);
byte[] buff = new byte[data.Length];
while(true)
{
int r = iis.Read(buff, 0, buff.Length);
if(r <= 0) break;
outs.Write(buff, 0, r);
}
outs.Flush();
outs.Seek(0, SeekOrigin.Begin);
}
finally
{
if(ins != null) ins.Close();
if(iis != null) iis.Close();
ins = null;
iis = null;
}
return outs;
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Got my first computer in the 90's and loved it even though it sounded like a coffeemaker.
Now getting paid for designing cool applications, and drinks the coffee instead of listening to it being made.