Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Finding and Unzipping a specific file using the ZipReader class

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • munderhill
    Participant
    Post count: 4
    #43910 |

    I need to extract the contents of a specific file in a zip archive using the ZipReader class directly into memory but the API does not seem to allow “finding” a file and then reading the contents. Is this possible? If so, would please provide a code snippet showing how to do this using the ZipReader class.

    munderhill
    Participant
    Post count: 4

    This needs to be done WITHOUT making a call to ReadItemData with Stream.Null as shown here:

    _zipReader.ReadItemData(Stream.Null, _buffer, 0, BUFFER_SIZE);

    munderhill
    Participant
    Post count: 4

    Whatever mechanism is used MUST be fast as I need to extract a variable number of files.

    Fawzi [Xceed]
    Member
    Post count: 722

    Hi,

    Xceed Real-Time Zip only supports reading (ans writing) archives in a sequential manner. Meaning it never “seeks” (this is also known as random access) in zip file when extracting.

    That means that to extract a specific item from an archive, you have to extract each item and discard its data until you get to the item you want to extract.

    It can’t be done otherwise with Xceed Real-Time Zip.

    You would need to use Xceed Zip for .NET to extract a specific item in your archive. Xceed Zip for .NET seeks in archives to access items directly.

    munderhill
    Participant
    Post count: 4

    OK, so what is the fastest method using the Xceed Zip for .NET? Please provide a sample.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.