UnzipStream

Description

abstract class Tinman.Core.IO.Streams.UnzipStream

Derived from

Disposable abstract
IPathInfo

The UnzipStream class is used to read archive data stream sequentially, visiting (and optionally extracting) the archive entries along the way.

To extract zero or more entries of an archive with this class, perform the following steps:

  1. Use IFileOps.Unzip or IDataStream.Unzip to obtain an UnzipStream object.

  2. Use Next to move to the next archive entry.

  3. Go to 2 to skip the current archive entry.

    • or -
      Use Data to extract the data of the current archive entry.

  4. Go to 2 to continue with processing the archive.

The Entry method can be used to extract a single archive entry with a single call.

Public / Methods

Data


[OwnerReturn]
public abstract method Data → ()

returns → IDataStream

The uncompressed data stream of the current archive entry.

Extracts the current archive entry and returns its data.

If Next has not been called yet or its last invocation returned null, this method will throw an IOException with IOError.NotFound.

IOException

If an I/O error has occurred.

Entry


[OwnerReturn] [OwnerThis]
public method Entry → (1)

name opt : string = null

If null, the method will move to the next entry in the archive. Otherwise, it will move to the next entry that has a matching name.

returns → IDataStream

The uncompressed data stream of the archive entry.

Moves to the next archive entry and extracts its data.

This method is a shortcut to Next and Data.

IOException

If an I/O error has occurred.

Next


public abstract method Next → (1)

name opt : string = null

If null, the method will move to the next entry in the archive. Otherwise, it will move to the next entry that has a matching name, skipping over mismatching ones.

returns → string

The name of the archive entry that has become current or null iff there are no more entries in the archive.

Moves to the next archive entry and returns its name.

IOException

If an I/O error has occurred.

Protected / Constructors

Unzip​Stream


protected constructor UnzipStream → (1)

stream in : IDataStream own

[not-null]
The archive data stream.

Creates a new instance of UnzipStream.

Protected / Methods

Error​No​Such​Entry


protected method ErrorNoSuchEntry → (2)

source in : string @ Tag

The error source tag.

name in : string

The archive entry name or null.

returns → IOException

The ready-to-throw exception.

Returns an error: no archive entry can be found for the given name.

Protected / Attributes

stream


[Owner]
protected attribute stream → (IDataStream)

The archive data stream.