BogaNet 1.4.0
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
BogaNet.Encoder.Base64 Class Reference

Base64 encoder class. More...

Static Public Member Functions

static byte[] FromBase64String (string base64string, bool useSaveFormat=true)
 Converts a Base64-string to a byte-array.
 
static string ToBase64String (byte[] bytes, bool useSaveFormat=true)
 Converts a byte-array to a Base64-string.
 
static string ToBase64String (string str, Encoding? encoding=null, bool useSaveFormat=true)
 Converts the value of a string to a Base64-string.
 
static string Base64FromFile (string file, bool useSaveFormat=true)
 Converts a file to a Base64-string.
 
static async Task< string > Base64FromFileAsync (string file, bool useSaveFormat=true)
 Converts a file to a Base64-string asynchronously.
 
static bool FileFromBase64 (string file, string base64string, bool useSaveFormat=true)
 Converts a Base64-string to a file.
 
static async Task< bool > FileFromBase64Async (string file, string base64string, bool useSaveFormat=true)
 Converts a Base64-string to a file asynchronously.
 

Detailed Description

Base64 encoder class.

Member Function Documentation

◆ Base64FromFile()

static string BogaNet.Encoder.Base64.Base64FromFile ( string file,
bool useSaveFormat = true )
static

Converts a file to a Base64-string.

Parameters
fileFile to convert
useSaveFormatUse safe format for Base64, suitable for URLs and files (optional, default: true)
Returns
File content as converted Base64-string
Exceptions
Exception

◆ Base64FromFileAsync()

static async Task< string > BogaNet.Encoder.Base64.Base64FromFileAsync ( string file,
bool useSaveFormat = true )
static

Converts a file to a Base64-string asynchronously.

Parameters
fileFile to convert
useSaveFormatUse safe format for Base64, suitable for URLs and files (optional, default: true)
Returns
File content as converted Base64-string
Exceptions
Exception

◆ FileFromBase64()

static bool BogaNet.Encoder.Base64.FileFromBase64 ( string file,
string base64string,
bool useSaveFormat = true )
static

Converts a Base64-string to a file.

Parameters
fileFile to write the content of the Base64-string
base64stringData as Base64-string
useSaveFormatUse safe format for Base64, suitable for URLs and files (optional, default: true)
Returns
True if the operation was successful
Exceptions
Exception

◆ FileFromBase64Async()

static async Task< bool > BogaNet.Encoder.Base64.FileFromBase64Async ( string file,
string base64string,
bool useSaveFormat = true )
static

Converts a Base64-string to a file asynchronously.

Parameters
fileFile to write the content of the Base64-string
base64stringData as Base64-string
useSaveFormatUse safe format for Base64, suitable for URLs and files (optional, default: true)
Returns
True if the operation was successful
Exceptions
Exception

◆ FromBase64String()

static byte[] BogaNet.Encoder.Base64.FromBase64String ( string base64string,
bool useSaveFormat = true )
static

Converts a Base64-string to a byte-array.

Parameters
base64stringData as Base64-string
useSaveFormatUse safe format for Base64, suitable for URLs and files (optional, default: true)
Returns
Data as byte-array
Exceptions
ArgumentNullException

◆ ToBase64String() [1/2]

static string BogaNet.Encoder.Base64.ToBase64String ( byte[] bytes,
bool useSaveFormat = true )
static

Converts a byte-array to a Base64-string.

Parameters
bytesData as byte-array
useSaveFormatUse safe format for Base64, suitable for URLs and files (optional, default: true)
Returns
Data as encoded Base64-string
Exceptions
ArgumentNullException

◆ ToBase64String() [2/2]

static string BogaNet.Encoder.Base64.ToBase64String ( string str,
Encoding? encoding = null,
bool useSaveFormat = true )
static

Converts the value of a string to a Base64-string.

Parameters
strInput string
encodingEncoding of the string (optional, default: UTF8)
useSaveFormatUse safe format for Base64, suitable for URLs and files (optional, default: true)
Returns
String value as converted Base64-string
Exceptions
ArgumentNullException

The documentation for this class was generated from the following file: