Click or drag to resize

IArchiveExtractorExtractItem Method

Extracts the archive file item to the specified stream. This method is for non-solid archives. See remarks.

Namespace: OpenDiscoverSDK.Interfaces.Extractors
Assembly: OpenDiscoverSDK.Interfaces (in OpenDiscoverSDK.Interfaces.dll) Version: 2025.4.4.0 (2025.4.4)
Syntax
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

ContentResult
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.
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).
See Also