Class EncodedFile
Represents a file transmitted over the wire as a base64-encoded string.
public abstract class EncodedFile
- Inheritance
-
EncodedFile
- Derived
- Inherited Members
Constructors
EncodedFile(string)
Initializes a new instance of the EncodedFile class.
protected EncodedFile(string base64EncodedFile)
Parameters
base64EncodedFilestringThe file as a Base64-encoded string.
Exceptions
- ArgumentNullException
If
base64EncodedFileis null.- FormatException
The length of
base64EncodedFile, ignoring white-space characters, is not zero or a multiple of 4.-or-
The format of
base64EncodedFileis invalid.base64EncodedFilecontains a non-base-64 character, more than two padding characters, or a non-white space-character among the padding characters.
Properties
AsBase64EncodedString
Gets the value of the encoded file as a Base64-encoded string.
public string AsBase64EncodedString { get; }
Property Value
AsByteArray
Gets the value of the encoded file as an array of bytes.
public byte[] AsByteArray { get; }
Property Value
- byte[]
Methods
SaveAsFile(string)
Saves the file, overwriting it if it already exists.
public abstract void SaveAsFile(string fileName)
Parameters
fileNamestringThe full path and file name to save the file to.
ToString()
public override string ToString()