public static byte[] CompressByteArray(byte[] inputByteArray)
{
MemoryStream ms = new MemoryStream();
GZipStream compressedzipStream = new GZipStream(ms, CompressionMode.Compress, true);
compressedzipStream.Write(inputByteArray, 0, inputByteArray.Length);
compressedzipStream.Close();
return ms.ToArray();
}