public byte[] Decompress(byte[] input)
{
if (input == null)
{
throw new ArgumentNullException("input");
}
var output = new List<byte>();
using (var ms = new MemoryStream(input))
{
var gs = new GZipStream(ms, CompressionMode.Decompress);
var readByte = gs.ReadByte();
while (readByte != -1)
{
output.Add((byte)readByte);
readByte = gs.ReadByte();
}
gs.Close();
ms.Close();
}
return output.ToArray();
}