IArchive ExtractorExtract Item Method
Extracts the archive file item to the specified stream. This method is for non-solid archives. See remarks.
Definition
Namespace: OpenDiscoverSDK.Interfaces.Extractors
Assembly: OpenDiscoverSDK.Interfaces (in OpenDiscoverSDK.Interfaces.dll) Version: 2026.2.6.0 (2026.02.06)
A ContentResult enumerated result. If the returned value is WrongPassword then this archive item requires a decryption password. User can make subsequent calls to this method using a password until Ok is returned or there are no more passwords to try.
Assembly: OpenDiscoverSDK.Interfaces (in OpenDiscoverSDK.Interfaces.dll) Version: 2026.2.6.0 (2026.02.06)
C#
ContentResult ExtractItem(
int index,
Stream stream,
string password = null
)Parameters
- index Int32
- The archive item given by this zero-offset index to extract to the input stream argument. An item's index is given by the Index property. See ChildDocuments.
- stream Stream
- Stream to write the decompressed item data. Only use MemoryStream if item's expanded size is "small enough" for your system's resources. It is up to user to define the subjective term "small enough". You should always test an archive item's expanded size first before extracting using method TestItem(Int32, Int64, String).
- password String (Optional)
Optional password (default is null). Archive items can have individual item passwords except for solid block compressed archives where all items have the same password because they are in compressed together into solid blocks.
Check the returned ContentResult value, if WrongPassword is the value then this archive item requires a decryption password. User can make subsequent calls to this method using a password until Ok is returned or there are no more passwords to try.
Return Value
ContentResultA ContentResult enumerated result. If the returned value is WrongPassword then this archive item requires a decryption password. User can make subsequent calls to this method using a password until Ok is returned or there are no more passwords to try.
Remarks
For solid block compressed archives where IsSolid is true, use method ExtractSolidBlockItems(GetItemStreamCallback, ItemExtractionFinishedCallback, String) instead. Using this method to extract all archive
items from solid archives can be VERY slow if archive has many items (the more items, the more time consuming the extraction).