System.Yaml.Serialization.YamlRepresenter.Base64Encode C# (CSharp) Méthode

Base64Encode() private static méthode

private static Base64Encode ( Type type, byte binary ) : string
type Type
binary byte
Résultat string
        private static string Base64Encode(Type type, byte[] binary)
        {
            var s = System.Convert.ToBase64String(binary);
            var sb = new StringBuilder();
            for ( int i = 0; i < s.Length; i += 80 ) {
                if ( i + 80 < s.Length ) {
                    sb.AppendLine(s.Substring(i, 80));
                } else {
                    sb.AppendLine(s.Substring(i));
                }
            }
            return sb.ToString();
        }