Returns BASE64-encoded representation of a bytes sequence. - CSharp System

CSharp examples for System:String Base64

Description

Returns BASE64-encoded representation of a bytes sequence.

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//w  ww. j  a  v  a  2  s.  c om

public class Main{
        /// <summary>
    ///   <para>Returns BASE64-encoded representation of a bytes sequence.</para>
    /// </summary>
    /// <param name="self">Bytes to convert to BASE64 encoding.</param>
    /// <returns>BASE64 string representation of <paramref name="self"/> array.</returns>
    /// <exception cref="ArgumentNullException">If <paramref name="self"/> is a <c>null</c> reference.</exception>
    /// <seealso cref="System.Convert.ToBase64String(byte[])"/>
    public static string Base64(this byte[] self)
    {
      Assertion.NotNull(self);

      return System.Convert.ToBase64String(self);
    }
}

Related Tutorials