@@ -124,38 +124,27 @@ public static ZipArchive Open(Stream stream, ReaderOptions? readerOptions = null
124124 ) ;
125125 }
126126
127- public static bool IsZipFile (
128- string filePath ,
129- string ? password = null ,
130- int bufferSize = ReaderOptions . DefaultBufferSize
131- ) => IsZipFile ( new FileInfo ( filePath ) , password , bufferSize ) ;
132-
133- public static bool IsZipFile (
134- FileInfo fileInfo ,
135- string ? password = null ,
136- int bufferSize = ReaderOptions . DefaultBufferSize
137- )
127+ public static bool IsZipFile ( string filePath , string ? password = null ) =>
128+ IsZipFile ( new FileInfo ( filePath ) , password ) ;
129+
130+ public static bool IsZipFile ( FileInfo fileInfo , string ? password = null )
138131 {
139132 if ( ! fileInfo . Exists )
140133 {
141134 return false ;
142135 }
143136 using Stream stream = fileInfo . OpenRead ( ) ;
144- return IsZipFile ( stream , password , bufferSize ) ;
137+ return IsZipFile ( stream , password ) ;
145138 }
146139
147- public static bool IsZipFile (
148- Stream stream ,
149- string ? password = null ,
150- int bufferSize = ReaderOptions . DefaultBufferSize
151- )
140+ public static bool IsZipFile ( Stream stream , string ? password = null )
152141 {
153142 var headerFactory = new StreamingZipHeaderFactory ( password , new ArchiveEncoding ( ) , null ) ;
154143 try
155144 {
156145 if ( stream is not SharpCompressStream )
157146 {
158- stream = new SharpCompressStream ( stream , bufferSize : bufferSize ) ;
147+ stream = new SharpCompressStream ( stream , bufferSize : Constants . BufferSize ) ;
159148 }
160149
161150 var header = headerFactory
@@ -177,18 +166,14 @@ public static bool IsZipFile(
177166 }
178167 }
179168
180- public static bool IsZipMulti (
181- Stream stream ,
182- string ? password = null ,
183- int bufferSize = ReaderOptions . DefaultBufferSize
184- )
169+ public static bool IsZipMulti ( Stream stream , string ? password = null )
185170 {
186171 var headerFactory = new StreamingZipHeaderFactory ( password , new ArchiveEncoding ( ) , null ) ;
187172 try
188173 {
189174 if ( stream is not SharpCompressStream )
190175 {
191- stream = new SharpCompressStream ( stream , bufferSize : bufferSize ) ;
176+ stream = new SharpCompressStream ( stream , bufferSize : Constants . BufferSize ) ;
192177 }
193178
194179 var header = headerFactory
@@ -229,7 +214,7 @@ protected override IEnumerable<ZipVolume> LoadVolumes(SourceStream stream)
229214 if ( streams . Count ( ) > 1 ) //test part 2 - true = multipart not split
230215 {
231216 streams [ 1 ] . Position += 4 ; //skip the POST_DATA_DESCRIPTOR to prevent an exception
232- var isZip = IsZipFile ( streams [ 1 ] , ReaderOptions . Password , ReaderOptions . BufferSize ) ;
217+ var isZip = IsZipFile ( streams [ 1 ] , ReaderOptions . Password ) ;
233218 streams [ 1 ] . Position -= 4 ;
234219 if ( isZip )
235220 {
0 commit comments