FileFormat.Detect

Detect(Stream, string)

Detect the file format from data stream, file name is optional for guessing types that has no magic header.

public static FileFormat Detect(Stream stream, string fileName)
ParameterTypeDescription
streamStream
fileNameString

Examples

byte[] bytes = new byte[100];//take the bytes from your source
var fmt = FileFormat.Detect(new MemoryStream(bytes), "input-file");
Console.WriteLine($"Input data format: {fmt}");

See Also


Detect(string)

Detect the file format from file name, file must be readable so Aspose.3D can detect the file format through file header.

public static FileFormat Detect(string fileName)
ParameterTypeDescription
fileNameString

Examples

var fmt = FileFormat.Detect("input.fbx");
Console.WriteLine($"Input file format: {fmt}");

See Also