Table of Contents

Class FileExtensions

Namespace
NuvTools.Storage
Assembly
NuvTools.Storage.dll

Provides extension methods for converting file content between different formats.

public static class FileExtensions
Inheritance
FileExtensions
Inherited Members

Methods

Base64StringFromContent(IFile)

Converts a stream to a Base64-encoded string.

public static string? Base64StringFromContent(this IFile value)

Parameters

value IFile

The file containing the stream to convert.

Returns

string

A Base64-encoded string representing the stream content, or null if the stream is null.

Exceptions

ArgumentNullException

Thrown when value is null.

ContentFromBase64String(IFile)

Converts a Base64-encoded string to a stream.

public static Stream? ContentFromBase64String(this IFile value)

Parameters

value IFile

The file containing the Base64 string to convert.

Returns

Stream

A MemoryStream containing the decoded bytes, or null if the Base64 string is null or empty.

Exceptions

ArgumentNullException

Thrown when value is null.