-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileTypeInfo.cs
More file actions
55 lines (54 loc) · 1.45 KB
/
FileTypeInfo.cs
File metadata and controls
55 lines (54 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
namespace FileHeaderCheck;
/// <summary>
/// 文件类型信息
/// </summary>
public class FileTypeInfo
{
/// <summary>
/// 魔数
/// </summary>
public byte[]? MagicBytes { get; init; }
/// <summary>
/// 第二段魔数
/// </summary>
public byte[]? MagicBytes2 { get; init; }
/// <summary>
/// 第二段魔数偏移量
/// <summary>
public int OffSet2 { get; init; }
/// 文件类型名称
/// </summary>
public string Name { get; init; }
/// <summary>
/// 文件扩展名
/// </summary>
public string Extension { get; init; }
/// <summary>
/// MIME类型
/// </summary>
public string? Mime { get; init; }
/// <summary>
/// 偏移量
/// </summary>
public int Offset { get; init; }
/// <summary>
///
/// </summary>
/// <param name="magicBytes"></param>
/// <param name="magicBytes2"></param>
/// <param name="offSet2"></param>
/// <param name="name"></param>
/// <param name="extension"></param>
/// <param name="mime"></param>
/// <param name="offSet"></param>
public FileTypeInfo(string name, string extension, byte[]? magicBytes, string? mime = null, int offSet = 0, byte[]? magicBytes2 = null, int offSet2 = 0)
{
MagicBytes = magicBytes;
MagicBytes2 = magicBytes2;
OffSet2 = offSet2;
Name = name;
Extension = extension;
Mime = mime;
Offset = offSet;
}
}