MediaTypeDetector
Namespace: Vercel.AI.Operations
public static class MediaTypeDetectorDetects media types from file signatures.
Inheritance: object
Methods
Section titled “Methods”Detect(byte[]?, string?)
Section titled “Detect(byte[]?, string?)”public static string? Detect(byte[]? data, string? topLevelType)Returns a media type for <code class=“paramref”>data</code>, or null when no signature matches.
Parameters
| Name | Type | Description |
|---|---|---|
data |
byte[] | |
topLevelType |
string |
Returns: string
ToBytes(object?)
Section titled “ToBytes(object?)”public static byte[] ToBytes(object? data)Decodes a base64 payload or returns the bytes unchanged.
Parameters
| Name | Type | Description |
|---|---|---|
data |
object |
Returns: byte[]
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product