@@ -15,7 +15,7 @@ public partial class ISO9660 : IExtractable
1515 /// <summary>
1616 /// List of extracted files by their sector offset
1717 /// </summary>
18- private readonly Dictionary < int , int > extractedFiles = [ ] ;
18+ private readonly Dictionary < int , uint > extractedFiles = [ ] ;
1919
2020 /// <summary>
2121 /// List of multi-extent files written, by their FileIdentifier
@@ -188,21 +188,21 @@ private bool ExtractFile(DirectoryRecord dr, Encoding encoding, int blockLength,
188188 if ( ! multiExtent && ( File . Exists ( filepath ) || Directory . Exists ( filepath ) ) )
189189 {
190190 // If it's the last extent of a multi-extent file, continue to append
191- if ( multiExtentFiles . Exists ( item => item . EqualsExactly ( dr . FileIdentifier ) ) )
191+ if ( ! multiExtentFiles . Exists ( item => item . EqualsExactly ( dr . FileIdentifier ) ) )
192192 {
193193 if ( includeDebug ) Console . WriteLine ( $ "File/Folder already exists, cannot extract: { filename } ") ;
194194 return false ;
195195 }
196196 }
197197
198- const int chunkSize = 2048 * 1024 ;
198+ const uint chunkSize = 2048 * 1024 ;
199199 lock ( _dataSourceLock )
200200 {
201201 long fileOffset = ( ( long ) dr . ExtentLocation + dr . ExtendedAttributeRecordLength ) * blockLength ;
202202 _dataSource . SeekIfPossible ( fileOffset , SeekOrigin . Begin ) ;
203203
204204 // Get the length, and make sure it won't EOF
205- int length = dr . ExtentLength ;
205+ uint length = dr . ExtentLength ;
206206 if ( length > _dataSource . Length - _dataSource . Position )
207207 return false ;
208208
@@ -211,13 +211,13 @@ private bool ExtractFile(DirectoryRecord dr, Encoding encoding, int blockLength,
211211 using var fs = File . Open ( filepath , FileMode . Append , FileAccess . Write , FileShare . ReadWrite ) ;
212212 while ( length > 0 )
213213 {
214- int bytesToRead = Math . Min ( length , chunkSize ) ;
214+ int bytesToRead = ( int ) Math . Min ( length , chunkSize ) ;
215215
216216 byte [ ] buffer = _dataSource . ReadBytes ( bytesToRead ) ;
217217 fs . Write ( buffer , 0 , bytesToRead ) ;
218218 fs . Flush ( ) ;
219219
220- length -= bytesToRead ;
220+ length -= ( uint ) bytesToRead ;
221221 }
222222
223223 // Mark the file as extracted
0 commit comments