public static void Decompress(Stream inStream, Stream outStream, bool isStreamOwner) { if ((inStream == null) || (outStream == null)) { throw new Exception("Null Stream"); } try { using (BZip2InputStream stream = new BZip2InputStream(inStream)) { stream.IsStreamOwner = isStreamOwner; StreamUtils.Copy(stream, outStream, new byte[0x1000]); } } finally { if (isStreamOwner) { outStream.Close(); } } }