Example #1
0
        /// <summary>
        /// Gets the MimeType for the specified data.
        /// </summary>
        /// <param name="data"><see cref="Byte"/> <see cref="Array"/> containing the data to investigate.</param>
        /// <returns>The Mime Type for the <paramref name="data"/> if successfull; otherwise return 'unknown/unknown'.</returns>
        /// <exception cref="ArgumentNullException">thrown if the <paramref name="data"/> is <c>Null</c> or <c>Empty</c>.</exception>
        public static string GetMimeType(byte[] data)
        {
            if (data.IsNullOrEmpty())
            {
                throw new ArgumentNullException("data");
            }

            return(MimeTypeHelper.GetMimeTypeByData(data));
        }