I'm using your library in many projects with custom validators.
In a particular case I have to validate / recognize a couple of CSV files and I would like to stick to the "Use FileTypeChecker" pattern. The problem with this approach is that the BufferDefaultSize is fixed to 20 bytes, which in many cases is below the threshold I need to accurately determine the file type.
So I modified it to be dynamically determined, based on the size of the largest MagicSequence defined for the FileType being checked. Since BufferDefaultSize wasn't a fitting name anymore I renamed it to BufferSize, making it a getter.
I also added an appropriate test (GetFileType_ShouldUseTheMinimalBufferSizeWhenUsingStream).
Thank you very much for your time and effort, best regards
Hello, @ziocampo, first thank you for your kind words and for your contribution to this project I really appreciate it! I am planning release it this weekend.
Hello @AJMitev
I'm using your library in many projects with custom validators.
In a particular case I have to validate / recognize a couple of CSV files and I would like to stick to the "Use FileTypeChecker" pattern. The problem with this approach is that the BufferDefaultSize is fixed to 20 bytes, which in many cases is below the threshold I need to accurately determine the file type.
So I modified it to be dynamically determined, based on the size of the largest MagicSequence defined for the FileType being checked. Since BufferDefaultSize wasn't a fitting name anymore I renamed it to BufferSize, making it a getter.
I also added an appropriate test (GetFileType_ShouldUseTheMinimalBufferSizeWhenUsingStream).
Thank you very much for your time and effort, best regards
Daniele (ziocampo)