1010
1111 public abstract class FileType : IFileType
1212 {
13-
14- private int BufferSize => Math . Max ( MaxMagicSequenceLength , 20 ) ;
13+ private int BufferSize => Math . Max ( MaxMagicSequenceLength , 20 ) ;
1514 private string _name ;
1615 private string _extension ;
1716 private MagicSequence [ ] _bytes ;
1817
19- protected FileType ( string name , string extension , byte [ ] magicBytes ) : this ( name , extension , new MagicSequence ( magicBytes ) )
18+ protected FileType ( string name , string extension , byte [ ] magicBytes ) : this ( name , extension ,
19+ new MagicSequence ( magicBytes ) )
2020 {
2121 }
2222
23- protected FileType ( string name , string extension , byte [ ] [ ] magicBytes ) : this ( name , extension , magicBytes . Select ( x => new MagicSequence ( x ) ) . ToArray ( ) )
23+ protected FileType ( string name , string extension , byte [ ] [ ] magicBytes ) : this ( name , extension ,
24+ magicBytes . Select ( x => new MagicSequence ( x ) ) . ToArray ( ) )
2425 {
2526 }
2627
@@ -85,7 +86,7 @@ public bool DoesMatchWith(Stream stream, bool resetPosition = true)
8586 if ( ! stream . CanRead || ( stream . Position != 0 && ! stream . CanSeek ) )
8687 throw new StreamMustBeReadableException ( ) ;
8788
88- if ( stream . Position != 0 && resetPosition )
89+ if ( stream . Position != 0 && resetPosition )
8990 stream . Position = 0 ;
9091
9192 var buffer = new byte [ BufferSize ] ;
@@ -108,7 +109,7 @@ public async Task<bool> DoesMatchWithAsync(Stream stream, bool resetPosition = t
108109 if ( ! stream . CanRead || ( stream . Position != 0 && ! stream . CanSeek ) )
109110 throw new StreamMustBeReadableException ( ) ;
110111
111- if ( stream . Position != 0 && resetPosition )
112+ if ( stream . Position != 0 && resetPosition )
112113 stream . Position = 0 ;
113114
114115 var buffer = new byte [ BufferSize ] ;
@@ -138,4 +139,4 @@ public int GetMatchingNumber(byte[] bytes)
138139
139140 private bool CompareBytes ( byte [ ] bytes ) => this . Bytes . Any ( byteArray => byteArray . Equals ( bytes ) ) ;
140141 }
141- }
142+ }
0 commit comments