@@ -142,7 +142,6 @@ public bool Extract(Stream? stream, string file, string outDir, bool includeDebu
142
142
/// <param name="filename">Filename for one cabinet in the set, if available</param>
143
143
/// <param name="outDir">Path to the output directory</param>
144
144
/// <param name="includeDebug">True to include debug data, false otherwise</param>
145
- /// <param name="forwardOnly">Indicates if decompression should be done forward-only</param>
146
145
/// <returns>Indicates if all files were able to be extracted</returns>
147
146
/// TODO: Remove once Serialization is updated
148
147
private static bool ExtractCabinet ( SabreTools . Serialization . Wrappers . MicrosoftCabinet cabArchive , string ? filename , string outDir , bool forwardOnly , bool includeDebug )
@@ -157,7 +156,7 @@ private static bool ExtractCabinet(SabreTools.Serialization.Wrappers.MicrosoftCa
157
156
for ( int f = 0 ; f < cabArchive . Model . Folders . Length ; f ++ )
158
157
{
159
158
var folder = cabArchive . Model . Folders [ f ] ;
160
- ExtractFolder ( cabArchive , filename , outDir , folder , f , forwardOnly , includeDebug ) ;
159
+ ExtractFolder ( cabArchive , filename , outDir , folder , f , includeDebug ) ;
161
160
}
162
161
163
162
return true ;
@@ -176,19 +175,17 @@ private static bool ExtractCabinet(SabreTools.Serialization.Wrappers.MicrosoftCa
176
175
/// <param name="outDir">Path to the output directory</param>
177
176
/// <param name="folder">Folder containing the blocks to decompress</param>
178
177
/// <param name="folderIndex">Index of the folder in the cabinet</param>
179
- /// <param name="forwardOnly">Indicates if decompression should be done forward-only</param>
180
178
/// <param name="includeDebug">True to include debug data, false otherwise</param>
181
179
/// TODO: Remove once Serialization is updated
182
180
private static void ExtractFolder ( SabreTools . Serialization . Wrappers . MicrosoftCabinet cabArchive ,
183
181
string ? filename ,
184
182
string outDir ,
185
183
CFFOLDER ? folder ,
186
184
int folderIndex ,
187
- bool forwardOnly ,
188
185
bool includeDebug )
189
186
{
190
187
// Decompress the blocks, if possible
191
- using var blockStream = DecompressBlocks ( cabArchive , filename , folder , folderIndex , forwardOnly ) ;
188
+ using var blockStream = DecompressBlocks ( cabArchive , filename , folder , folderIndex ) ;
192
189
if ( blockStream == null || blockStream . Length == 0 )
193
190
return ;
194
191
@@ -235,15 +232,12 @@ private static void ExtractFolder(SabreTools.Serialization.Wrappers.MicrosoftCab
235
232
/// <param name="filename">Filename for one cabinet in the set, if available</param>
236
233
/// <param name="folder">Folder containing the blocks to decompress</param>
237
234
/// <param name="folderIndex">Index of the folder in the cabinet</param>
238
- /// <param name="forwardOnly">Indicates if decompression should be done forward-only</param>
239
235
/// <returns>Stream representing the decompressed data on success, null otherwise</returns>
240
236
/// TODO: Remove once Serialization is updated
241
- private static Stream ? DecompressBlocks ( SabreTools . Serialization . Wrappers . MicrosoftCabinet cabArchive , string ? filename , CFFOLDER ? folder , int folderIndex , bool forwardOnly )
237
+ private static Stream ? DecompressBlocks ( SabreTools . Serialization . Wrappers . MicrosoftCabinet cabArchive , string ? filename , CFFOLDER ? folder , int folderIndex )
242
238
{
243
239
// Ensure data blocks
244
- var dataBlocks = forwardOnly
245
- ? GetDataBlocksForward ( cabArchive , filename , folder , folderIndex )
246
- : GetDataBlocks ( cabArchive , filename , folder , folderIndex ) ;
240
+ var dataBlocks = GetDataBlocks ( cabArchive , filename , folder , folderIndex ) ;
247
241
if ( dataBlocks == null || dataBlocks . Length == 0 )
248
242
return null ;
249
243
@@ -375,17 +369,6 @@ private static CompressionType GetCompressionType(CFFOLDER folder)
375
369
return [ .. prevBlocks , .. folder . DataBlocks , .. nextBlocks ] ;
376
370
}
377
371
378
- /// <summary>
379
- /// Get the set of data blocks for a folder using forward reading only
380
- /// </summary>
381
- /// <param name="filename">Filename for one cabinet in the set, if available</param>
382
- /// <param name="folder">Folder containing the blocks to decompress</param>
383
- /// <param name="folderIndex">Index of the folder in the cabinet</param>
384
- /// <returns>Array of data blocks on success, null otherwise</returns>
385
- /// TODO: Remove once Serialization is updated
386
- private static CFDATA [ ] ? GetDataBlocksForward ( SabreTools . Serialization . Wrappers . MicrosoftCabinet cabArchive , string ? filename , CFFOLDER ? folder , int folderIndex )
387
- => GetDataBlocks ( cabArchive , filename , folder , folderIndex , skipPrev : true , skipNext : false ) ;
388
-
389
372
/// <summary>
390
373
/// Get all files for the current folder index
391
374
/// </summary>
0 commit comments