Class StreamHelper
Helper class for working with streams and detecting image types.
Inheritance
System.Object
StreamHelper
Namespace: IronWord.Models.Extensions
Assembly: IronWord.dll
Syntax
public static class StreamHelper : Object
Methods
GetImageType(FileStream)
Determines the image type based on the content of the file stream.
Declaration
public static ImageType GetImageType(this FileStream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.FileStream | stream | The input file stream to analyze. |
Returns
| Type | Description |
|---|---|
| ImageType | The detected image type. |
GetImageType(MemoryStream)
Determines the image type based on the content of the stream.
Declaration
public static ImageType GetImageType(this MemoryStream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.MemoryStream | stream | The input stream to analyze. |
Returns
| Type | Description |
|---|---|
| ImageType | The detected image type. |
GetImageType(Stream)
Determines the image type based on the content of the stream.
Declaration
public static ImageType GetImageType(this Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | The input stream to analyze. |
Returns
| Type | Description |
|---|---|
| ImageType | The detected image type. |
ToBase64(FileStream)
Converts the content of the file stream to a base64-encoded string.
Declaration
public static string ToBase64(this FileStream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.FileStream | stream | The input file stream to convert. |
Returns
| Type | Description |
|---|---|
| System.String | A base64-encoded string representing the file stream content. |
ToBase64(Stream)
Converts the content of the stream to a base64-encoded string.
Declaration
public static string ToBase64(this Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | The input stream to convert. |
Returns
| Type | Description |
|---|---|
| System.String | A base64-encoded string representing the stream content. |