public static byte[] Compress(this string text, string compressionType) { if (compressionType == CompressionTypes.Deflate) return Deflate(text); if (compressionType == CompressionTypes.GZip) return GZip(text); throw new NotSupportedException(compressionType); }