ByteArrayExtensionsToBase64String Method
Converts the given bytes into a Base64 encoded string.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
public static string ToBase64String(
this byte[] bytes,
int lineLength = 0,
int indentSize = 0,
char indentChar = '',
bool indentSingleLine = false
)
<ExtensionAttribute>
Public Shared Function ToBase64String (
bytes As Byte(),
Optional lineLength As Integer = 0,
Optional indentSize As Integer = 0,
Optional indentChar As Char = ""C,
Optional indentSingleLine As Boolean = false
) As String
public:
[ExtensionAttribute]
static String^ ToBase64String(
array<unsigned char>^ bytes,
int lineLength = 0,
int indentSize = 0,
wchar_t indentChar = L'',
bool indentSingleLine = false
)
[<ExtensionAttribute>]
static member ToBase64String :
bytes : byte[] *
?lineLength : int *
?indentSize : int *
?indentChar : char *
?indentSingleLine : bool
(* Defaults:
let _lineLength = defaultArg lineLength 0
let _indentSize = defaultArg indentSize 0
let _indentChar = defaultArg indentChar ''
let _indentSingleLine = defaultArg indentSingleLine false
*)
-> string
- bytes Byte
- The bytes to convert.
- lineLength Int32 (Optional)
- Specifies the length of a line in the result not counting the indentation. When 0 or less, the result will not be wrapped to lines. This parameter is optional.
Default value: 0. - indentSize Int32 (Optional)
- Size of the indentation. If greater than zero, the new lines will be prefixed with as many indentChar characters as this parameter specifies. This parameter is optional.
Default value: 0. - indentChar Char (Optional)
- The character to be used for the indentation. This parameter is optional.
Default value: ' ' (space) - indentSingleLine Boolean (Optional)
- If set to , then a single line result will be indented, too. This parameter is optional.
Default value: .
StringThe string representation, in base 64, of the contents of
bytes.In Visual Basic and C#, you can call this method as an instance method on any object of type
Byte. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).