ReMime/ReMime/IMediaContentResolver.cs
H. Utku Maden a89e51f5e7
ReMime - File type detector from hell.
(I just wanted to reference the first commit message from the git source code.)
2024-05-25 09:01:52 +03:00

25 lines
968 B
C#

using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
namespace ReMime
{
public interface IMediaContentResolver : IMediaTypeResolver
{
/// <summary>
/// Resolve media type via file extension.
/// </summary>
/// <param name="str">The stream to match the content with.</param>
/// <param name="mediaType">The media type for this extension.</param>
/// <returns>True if content matched.</returns>
bool TryResolve(Stream str, [NotNullWhen(true)] out MediaType? mediaType);
/// <summary>
/// Resolve media type via file extension.
/// </summary>
/// <param name="content">The stream to match the content with.</param>
/// <param name="mediaType">The media type for this extension.</param>
/// <returns>True if content matched.</returns>
bool TryResolve(ReadOnlySpan<byte> content, [NotNullWhen(true)] out MediaType? mediaType);
}
}