OrganicBit.Zip

DOC.NET Documented Class Library

OrganicBit.Zip Namespace

Hierarchy diagram

Classes

Class | Description
ZipEntry | Represents a entry in a zip file.
ZipEntryCollection | A collection that stores ZipEntry objects.
ZipEntryCollection.ZipEntryEnumerator | Enumerator for ZipEntryCollection.
ZipException | Thrown whenever an error occurs during the build.
ZipReader | Provides support for reading files in the ZIP file format. Includes support for both compressed and uncompressed entries.
ZipWriter | Provides support for writing files in the ZIP file format. Includes support for both compressed and uncompressed entries.

Enumerations

Enumeration | Description
CompressionLevel | Specifies the amount of compression to apply to compressed zip entires.
CompressionMethod | Specifies how the the zip entry should be compressed.


CompressionLevel Enumeration

Specifies the amount of compression to apply to compressed zip entires.

public enum CompressionLevel

Members

Member Name | Description
Default | Default compression level. A good choice for speed and size.
None | Do not perfrom compression.
Fastest | Compress the entry as fast as possible size trading size for time.
Average | Compress the entry using a balance of size and time.
Smallest | Compress the entry to smallest possible size trading time for size.

Requirements

Namespace: OrganicBit.Zip Namespace

Assembly: Zip.dll

See Also

OrganicBit.Zip Namespace


CompressionMethod Enumeration

Specifies how the the zip entry should be compressed.

public enum CompressionMethod

Members

Member Name | Description
Stored | No compression.
Deflated | Default and only supported compression method.

Requirements

Namespace: OrganicBit.Zip Namespace

Assembly: Zip.dll

See Also

OrganicBit.Zip Namespace


ZipEntry Class

Represents a entry in a zip file.

System.Object
ZipEntry

public class ZipEntry

Requirements

Namespace: OrganicBit.Zip Namespace

Assembly: Zip.dll

See Also

ZipEntry Members | OrganicBit.Zip Namespace


ZipEntry Members

Public Instance Constructors

ZipEntry Constructor Initializes a instance of the ZipEntry class with the given name.

Public Instance Properties

Comment | Gets and sets the local file comment for the entry.
CompressedLength | Gets the compressed size of the entry data in bytes, or -1 if not known.
Crc | Gets the CRC-32 checksum of the uncompressed entry data.
ExtraField | Gets and sets the optional extra field data for the entry.
IsDirectory | Flag that indicates if this entry is a directory or a file.
Length | Gets the size of the uncompressed entry data in in bytes.
Level | Gets and sets the default compresion level for zip file entries. See CompressionMethod for a partial list of values.
Method | Gets and sets the default compresion method for zip file entries. See CompressionMethod for a list of possible values.
ModifiedTime | Gets and sets the modification time of the entry.
Name | Gets and sets the name of the entry.
Ratio | Gets the compression ratio as a percentage.

Public Instance Methods

Equals (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
ToString | Returns a string representation of the Zip entry.

Protected Instance Methods

Finalize (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
MemberwiseClone (inherited from System.Object) | Select the method name to go to the Microsoft documentation.

See Also

ZipEntry Class | OrganicBit.Zip Namespace


ZipEntry Constructor

Initializes a instance of the ZipEntry class with the given name.

public ZipEntry(
   string name
);

Parameters

name

The name of entry that will be stored in the directory of the zip file.

See Also

ZipEntry Class | ZipEntry Members | OrganicBit.Zip Namespace


ZipEntry Properties

The properties of the ZipEntry class are listed below. For a complete list of ZipEntry class members, see the ZipEntry Members topic.

Public Instance Properties

Comment | Gets and sets the local file comment for the entry.
CompressedLength | Gets the compressed size of the entry data in bytes, or -1 if not known.
Crc | Gets the CRC-32 checksum of the uncompressed entry data.
ExtraField | Gets and sets the optional extra field data for the entry.
IsDirectory | Flag that indicates if this entry is a directory or a file.
Length | Gets the size of the uncompressed entry data in in bytes.
Level | Gets and sets the default compresion level for zip file entries. See CompressionMethod for a partial list of values.
Method | Gets and sets the default compresion method for zip file entries. See CompressionMethod for a list of possible values.
ModifiedTime | Gets and sets the modification time of the entry.
Name | Gets and sets the name of the entry.
Ratio | Gets the compression ratio as a percentage.

See Also

ZipEntry Class | OrganicBit.Zip Namespace


ZipEntry.Comment Property

Gets and sets the local file comment for the entry.

public string Comment {get; set;}

Remarks

Currently only Ascii 8 bit characters are supported in comments.

A comment cannot exceed 65535 bytes.

See Also

ZipEntry Class | ZipEntry Members | OrganicBit.Zip Namespace


ZipEntry.CompressedLength Property

Gets the compressed size of the entry data in bytes, or -1 if not known.

public long CompressedLength {get;}

See Also

ZipEntry Class | ZipEntry Members | OrganicBit.Zip Namespace


ZipEntry.Crc Property

Gets the CRC-32 checksum of the uncompressed entry data.

public uint Crc {get;}

See Also

ZipEntry Class | ZipEntry Members | OrganicBit.Zip Namespace


ZipEntry.ExtraField Property

Gets and sets the optional extra field data for the entry.

public byte[] ExtraField {get; set;}

Remarks

ExtraField data cannot exceed 65535 bytes.

See Also

ZipEntry Class | ZipEntry Members | OrganicBit.Zip Namespace


ZipEntry.IsDirectory Property

Flag that indicates if this entry is a directory or a file.

public bool IsDirectory {get;}

See Also

ZipEntry Class | ZipEntry Members | OrganicBit.Zip Namespace


ZipEntry.Length Property

Gets the size of the uncompressed entry data in in bytes.

public long Length {get;}

See Also

ZipEntry Class | ZipEntry Members | OrganicBit.Zip Namespace


ZipEntry.Level Property

Gets and sets the default compresion level for zip file entries. See CompressionMethod for a partial list of values.

public int Level {get; set;}

See Also

ZipEntry Class | ZipEntry Members | OrganicBit.Zip Namespace


ZipEntry.Method Property

Gets and sets the default compresion method for zip file entries. See CompressionMethod for a list of possible values.

public CompressionMethod Method {get; set;}

See Also

ZipEntry Class | ZipEntry Members | OrganicBit.Zip Namespace


ZipEntry.ModifiedTime Property

Gets and sets the modification time of the entry.

public System.DateTime ModifiedTime {get; set;}

See Also

ZipEntry Class | ZipEntry Members | OrganicBit.Zip Namespace


ZipEntry.Name Property

Gets and sets the name of the entry.

public string Name {get; set;}

Remarks

Currently only Ascii 8 bit characters are supported in comments.

A comment cannot exceed 65535 bytes.

See Also

ZipEntry Class | ZipEntry Members | OrganicBit.Zip Namespace


ZipEntry.Ratio Property

Gets the compression ratio as a percentage.

public float Ratio {get;}

Remarks

Returns -1.0 if unknown.

See Also

ZipEntry Class | ZipEntry Members | OrganicBit.Zip Namespace


ZipEntry.ToString Method

Returns a string representation of the Zip entry.

public override string ToString();

See Also

ZipEntry Class | ZipEntry Members | OrganicBit.Zip Namespace


ZipEntryCollection Class

A collection that stores ZipEntry objects.

System.Object
System.Collections.CollectionBase
ZipEntryCollection

public class ZipEntryCollection : CollectionBase, IList, ICollection, IEnumerable

Requirements

Namespace: OrganicBit.Zip Namespace

Assembly: Zip.dll

See Also

ZipEntryCollection Members | OrganicBit.Zip Namespace | ZipEntryCollection


ZipEntryCollection Members

Public Instance Constructors

ZipEntryCollection Overloaded. Initialize a new instance of the ZipEntryCollection class.

Public Instance Properties

Count (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
Item | Represents the entry at the specified index of the ZipEntry.

Public Instance Methods

Add | Adds a ZipEntry with the specified value to the ZipEntryCollection.
AddRange | Overloaded. Copies the elements of an array to the end of the ZipEntryCollection.
Clear (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
Contains | Gets a value indicating whether the ZipEntryCollection contains the specified ZipEntry.
CopyTo | Copies the ZipEntryCollection values to a one-dimensional System.Array instance at the specified index.
Equals (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetEnumerator (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
IndexOf | Returns the index of a ZipEntry in the ZipEntryCollection.
Insert | Inserts a ZipEntry into the ZipEntryCollection at the specified index.
Remove | Removes a specific ZipEntry from the ZipEntryCollection.
RemoveAt (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
ToString (inherited from System.Object) | Select the method name to go to the Microsoft documentation.

Protected Instance Properties

InnerList (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
List (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.

Protected Instance Methods

Finalize (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
MemberwiseClone (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
OnClear (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnClearComplete (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnInsert (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnInsertComplete (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnRemove (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnRemoveComplete (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnSet (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnSetComplete (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnValidate (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.

See Also

ZipEntryCollection Class | OrganicBit.Zip Namespace | ZipEntryCollection


ZipEntryCollection Constructor

DOC.NET Documented Class Library

ZipEntryCollection

Initializes a new instance of ZipEntryCollection.

Overload List

Initializes a new instance of ZipEntryCollection.

public ZipEntryCollection();

Initializes a new instance of ZipEntryCollection based on another ZipEntryCollection.

public ZipEntryCollection(ZipEntryCollection);

Initializes a new instance of ZipEntryCollection containing any array of ZipEntry objects.

public ZipEntryCollection(ZipEntry[]);

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace


ZipEntryCollection Constructor()

Initializes a new instance of ZipEntryCollection.

public ZipEntryCollection();

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace | ZipEntryCollection Constructor Overload List


ZipEntryCollection Constructor()

Initializes a new instance of ZipEntryCollection based on another ZipEntryCollection.

public ZipEntryCollection(
   ZipEntryCollection value
);

Parameters

value

A ZipEntryCollection from which the contents are copied.

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace | ZipEntryCollection Constructor Overload List


ZipEntryCollection Constructor(OrganicBit.Zip.ZipEntry[])

Initializes a new instance of ZipEntryCollection containing any array of ZipEntry objects.

public ZipEntryCollection(
   ZipEntry[] value
);

Parameters

value

A array of ZipEntry objects with which to intialize the collection.

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace | ZipEntryCollection Constructor Overload List


ZipEntryCollection.Item Property

Represents the entry at the specified index of the ZipEntry.

public ZipEntry this[
   int index
] {get; set;}

Parameters

index

The zero-based index of the entry to locate in the collection.

Property Value

The entry at the specified index of the collection.

Exceptions

Exception Type | Condition
 | is outside the valid range of indexes for the collection.

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace


ZipEntryCollection Methods

The methods of the ZipEntryCollection class are listed below. For a complete list of ZipEntryCollection class members, see the ZipEntryCollection Members topic.

Public Instance Methods

Add | Adds a ZipEntry with the specified value to the ZipEntryCollection.
AddRange | Overloaded. Copies the elements of an array to the end of the ZipEntryCollection.
Clear (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
Contains | Gets a value indicating whether the ZipEntryCollection contains the specified ZipEntry.
CopyTo | Copies the ZipEntryCollection values to a one-dimensional System.Array instance at the specified index.
Equals (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetEnumerator (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
IndexOf | Returns the index of a ZipEntry in the ZipEntryCollection.
Insert | Inserts a ZipEntry into the ZipEntryCollection at the specified index.
Remove | Removes a specific ZipEntry from the ZipEntryCollection.
RemoveAt (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
ToString (inherited from System.Object) | Select the method name to go to the Microsoft documentation.

Protected Instance Methods

Finalize (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
MemberwiseClone (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
OnClear (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnClearComplete (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnInsert (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnInsertComplete (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnRemove (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnRemoveComplete (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnSet (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnSetComplete (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.
OnValidate (inherited from System.Collections.CollectionBase) | Select the method name to go to the Microsoft documentation.

See Also

ZipEntryCollection Class | OrganicBit.Zip Namespace | ZipEntryCollection


ZipEntryCollection.Add Method

Adds a ZipEntry with the specified value to the ZipEntryCollection.

public int Add(
   ZipEntry value
);

Parameters

value

The ZipEntry to add.

Return Value

The index at which the new element was inserted.

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace | AddRange


AddRange Method

DOC.NET Documented Class Library

ZipEntryCollection.AddRange

Copies the elements of an array to the end of the ZipEntryCollection.

Overload List

Copies the elements of an array to the end of the ZipEntryCollection.

public void AddRange(ZipEntry[]);

Adds the contents of another ZipEntryCollection to the end of the collection.

public void AddRange(ZipEntryCollection);

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace | Add


ZipEntryCollection.AddRange Method(OrganicBit.Zip.ZipEntry[])

Copies the elements of an array to the end of the ZipEntryCollection.

public void AddRange(
   ZipEntry[] value
);

Parameters

value

An array of type ZipEntry containing the objects to add to the collection.

Return Value

None.

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace | ZipEntryCollection.AddRange Overload List | Add


ZipEntryCollection.AddRange Method()

Adds the contents of another ZipEntryCollection to the end of the collection.

public void AddRange(
   ZipEntryCollection value
);

Parameters

value

A ZipEntryCollection containing the objects to add to the collection.

Return Value

None.

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace | ZipEntryCollection.AddRange Overload List | Add


ZipEntryCollection.Contains Method

Gets a value indicating whether the ZipEntryCollection contains the specified ZipEntry.

public bool Contains(
   ZipEntry value
);

Parameters

value

The ZipEntry to locate.

Return Value

if the ZipEntry is contained in the collection; otherwise, .

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace | IndexOf


ZipEntryCollection.CopyTo Method

Copies the ZipEntryCollection values to a one-dimensional System.Array instance at the specified index.

public void CopyTo(
   ZipEntry[] array,
   int index
);

Parameters

array

The one-dimensional System.Array that is the destination of the values copied from ZipEntryCollection .

index

The index in where copying begins.

Return Value

None.

Exceptions

Exception Type | Condition
 | is multidimensional. -or- The number of elements in the ZipEntryCollection is greater than the available space between and the end of .
 | is .
 | is less than 's lowbound.

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace | System.Array


GetEnumerator Method

DOC.NET Documented Class Library

ZipEntryCollection.GetEnumerator

Returns an enumerator that can iterate through the ZipEntryCollection.

Overload List

Returns an enumerator that can iterate through the ZipEntryCollection.

public System.Collections.IEnumerator GetEnumerator();

Returns an enumerator that can iterate through the ZipEntryCollection.

public ZipEntryCollection+ZipEntryEnumerator GetEnumerator();

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace | System.Collections.IEnumerator


ZipEntryCollection.GetEnumerator Method()

Returns an enumerator that can iterate through the ZipEntryCollection.

public final System.Collections.IEnumerator GetEnumerator();

Return Value

None.

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace | ZipEntryCollection.GetEnumerator Overload List | System.Collections.IEnumerator

ZipEntryCollection.GetEnumerator Method()
DOC.NET Documented Class Library

ZipEntryCollection.GetEnumerator Method()

Returns an enumerator that can iterate through the ZipEntryCollection.

public ZipEntryCollection+ZipEntryEnumerator GetEnumerator();

Return Value

None.

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace | ZipEntryCollection.GetEnumerator Overload List | System.Collections.IEnumerator


ZipEntryCollection.IndexOf Method

Returns the index of a ZipEntry in the ZipEntryCollection.

public int IndexOf(
   ZipEntry value
);

Parameters

value

The ZipEntry to locate.

Return Value

The index of the ZipEntry of in the ZipEntryCollection, if found; otherwise, -1.

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace | Contains


ZipEntryCollection.Insert Method

Inserts a ZipEntry into the ZipEntryCollection at the specified index.

public void Insert(
   int index,
   ZipEntry value
);

Parameters

index

The zero-based index where should be inserted.

value

Return Value

None.

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace | Add


ZipEntryCollection.Remove Method

Removes a specific ZipEntry from the ZipEntryCollection.

public void Remove(
   ZipEntry value
);

Parameters

value

The ZipEntry to remove from the ZipEntryCollection .

Return Value

None.

Exceptions

Exception Type | Condition
 | is not found in the Collection.

See Also

ZipEntryCollection Class | ZipEntryCollection Members | OrganicBit.Zip Namespace


ZipEntryCollection.ZipEntryEnumerator Class

Enumerator for ZipEntryCollection.

System.Object
ZipEntryCollection.ZipEntryEnumerator

public class ZipEntryCollection.ZipEntryEnumerator : IEnumerator

Requirements

Namespace: OrganicBit.Zip Namespace

Assembly: Zip.dll

See Also

ZipEntryCollection.ZipEntryEnumerator Members | OrganicBit.Zip Namespace


ZipEntryCollection.ZipEntryEnumerator Members

Public Instance Constructors

ZipEntryCollection.ZipEntryEnumerator Constructor

Public Instance Properties

Current

Public Instance Methods

Equals (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
MoveNext |
Reset |
ToString (inherited from System.Object) | Select the method name to go to the Microsoft documentation.

Protected Instance Methods

Finalize (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
MemberwiseClone (inherited from System.Object) | Select the method name to go to the Microsoft documentation.

See Also

ZipEntryCollection.ZipEntryEnumerator Class | OrganicBit.Zip Namespace


ZipEntryCollection.ZipEntryEnumerator Constructor

public ZipEntryCollection.ZipEntryEnumerator(
   ZipEntryCollection mappings
);

Parameters

mappings

See Also

ZipEntryCollection.ZipEntryEnumerator Class | ZipEntryCollection.ZipEntryEnumerator Members | OrganicBit.Zip Namespace


ZipEntryCollection.ZipEntryEnumerator.Current Property

public ZipEntry Current {get;}

See Also

ZipEntryCollection.ZipEntryEnumerator Class | ZipEntryCollection.ZipEntryEnumerator Members | OrganicBit.Zip Namespace


ZipEntryCollection.ZipEntryEnumerator Methods

The methods of the ZipEntryCollection.ZipEntryEnumerator class are listed below. For a complete list of ZipEntryCollection.ZipEntryEnumerator class members, see the ZipEntryCollection.ZipEntryEnumerator Members topic.

Public Instance Methods

Equals (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
MoveNext |
Reset |
ToString (inherited from System.Object) | Select the method name to go to the Microsoft documentation.

Protected Instance Methods

Finalize (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
MemberwiseClone (inherited from System.Object) | Select the method name to go to the Microsoft documentation.

See Also

ZipEntryCollection.ZipEntryEnumerator Class | OrganicBit.Zip Namespace


ZipEntryCollection.ZipEntryEnumerator.MoveNext Method

public bool MoveNext();

See Also

ZipEntryCollection.ZipEntryEnumerator Class | ZipEntryCollection.ZipEntryEnumerator Members | OrganicBit.Zip Namespace


ZipEntryCollection.ZipEntryEnumerator.Reset Method

public void Reset();

See Also

ZipEntryCollection.ZipEntryEnumerator Class | ZipEntryCollection.ZipEntryEnumerator Members | OrganicBit.Zip Namespace


ZipException Class

Thrown whenever an error occurs during the build.

System.Object
System.Exception
System.ApplicationException
ZipException

public class ZipException : ApplicationException, ISerializable

Requirements

Namespace: OrganicBit.Zip Namespace

Assembly: Zip.dll

See Also

ZipException Members | OrganicBit.Zip Namespace


ZipException Members

Public Instance Constructors

ZipException Overloaded. Initialize a new instance of the ZipException class.

Public Instance Properties

HelpLink (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
InnerException (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Message (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Source (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
StackTrace (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
TargetSite (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.

Public Instance Methods

Equals (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetBaseException (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetObjectData (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
GetType (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.

Protected Instance Properties

HResult (inherited from System.Exception) Select the method name to go to the Microsoft documentation.

Protected Instance Methods

Finalize (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
MemberwiseClone (inherited from System.Object) | Select the method name to go to the Microsoft documentation.

See Also

ZipException Class | OrganicBit.Zip Namespace


ZipException Constructor

DOC.NET Documented Class Library

ZipException

Constructs an exception with no descriptive information.

Overload List

Constructs an exception with no descriptive information.

public ZipException();

Constructs an exception with a descriptive message.

public ZipException(string);

Constructs an exception with a descriptive message and a reference to the instance of the Exception that is the root cause of the this exception.

public ZipException(string,System.Exception);

Initializes a new instance of the BuildException class with serialized data.

public ZipException(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext);

See Also

ZipException Class | ZipException Members | OrganicBit.Zip Namespace


ZipException Constructor()

Constructs an exception with no descriptive information.

public ZipException();

See Also

ZipException Class | ZipException Members | OrganicBit.Zip Namespace | ZipException Constructor Overload List


ZipException Constructor(System.String)

Constructs an exception with a descriptive message.

public ZipException(
   string message
);

Parameters

message

The error message that explains the reason for the exception.

See Also

ZipException Class | ZipException Members | OrganicBit.Zip Namespace | ZipException Constructor Overload List


ZipException Constructor(System.String,System.Exception)

Constructs an exception with a descriptive message and a reference to the instance of the Exception that is the root cause of the this exception.

public ZipException(
   string message,
   System.Exception innerException
);

Parameters

message

The error message that explains the reason for the exception.

innerException

An instance of Exception that is the cause of the current Exception. If is non-null, then the current Exception is raised in a catch block handling innerException.

See Also

ZipException Class | ZipException Members | OrganicBit.Zip Namespace | ZipException Constructor Overload List


ZipException Constructor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)

Initializes a new instance of the BuildException class with serialized data.

public ZipException(
   System.Runtime.Serialization.SerializationInfo info,
   System.Runtime.Serialization.StreamingContext context
);

Parameters

info

The object that holds the serialized object data.

context

The contextual information about the source or destination.

See Also

ZipException Class | ZipException Members | OrganicBit.Zip Namespace | ZipException Constructor Overload List


ZipReader Class

Provides support for reading files in the ZIP file format. Includes support for both compressed and uncompressed entries.

System.Object
ZipReader

public class ZipReader : IEnumerator, IDisposable

Example

This example shows how to view the entries in a ZIP file.

            public static void View(string zipFileName) {
                ZipReader reader = new ZipReader(zipFileName);

                Console.WriteLine("Archive: {0} ({1} files)", zipFileName, reader.Entries.Count);
                Console.WriteLine(reader.Comment);

                string format = "{0,8} {1,8} {2,5} {3,10} {4,5} {5}";
                Console.WriteLine(format, " Length ", "  Size  ", "Ratio", "   Date   ", "Time ", "Name");
                Console.WriteLine(format, "--------", "--------", "-----", "----------", "-----", "----");

                foreach (ZipEntry entry in reader.Entries) {
                    if (!entry.IsDirectory) {
                        Console.WriteLine(format,
                            entry.Length,
                            entry.CompressedLength,
                            entry.Ratio.ToString("P0"),
                            entry.ModifiedTime.ToString("yyyy-MM-dd"),
                            entry.ModifiedTime.ToString("hh:mm"),
                            entry.Name);
                    }
                }
                reader.Close();
            }
This example shows how to extract files from a ZIP file.
            public static void Extract(string zipFileName) {
                ZipReader reader = new ZipReader(zipFileName);
                Console.WriteLine("Archive: {0}", zipFileName);
                Console.WriteLine(reader.Comment);

                // buffer to hold temp bytes
                byte[] buffer = new byte[4096];
                int byteCount;

                // Get the zipped entries
                while (reader.MoveNext()) {
                    ZipEntry entry = reader.Current;

                    if (entry.IsDirectory) {
                        Directory.CreateDirectory(entry.Name);
                    } else {
                        Console.Write("  {0}", entry.Name);

                        // create output stream
                        FileStream writer = File.Open(entry.Name, FileMode.Create);

                        // write uncompressed data
                        while ((byteCount = reader.Read(buffer, 0, buffer.Length)) > 0) {
                            Console.Write(".");
                            writer.Write(buffer, 0, byteCount);
                        }
                        writer.Close();
                        Console.WriteLine();
                    }
                }
                reader.Close();
            }

Requirements

Namespace: OrganicBit.Zip Namespace

Assembly: Zip.dll

See Also

ZipReader Members | OrganicBit.Zip Namespace


ZipReader Members

Public Instance Constructors

ZipReader Constructor Initializes a instance of the ZipReader class for reading the zip file with the given name.

Public Instance Properties

Comment | Gets the global comment for the zip file.
Current | Gets the current entry in the zip file..
Entries | Gets a ZipEntryCollection object that contains all the entries in the zip file directory.
Name | Gets the name of the zip file that was passed to the constructor.

Public Instance Methods

Close | Closes the zip file and releases any resources.
Equals (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
MoveNext | Advances the enumerator to the next element of the collection.Sets Current to the next zip entry.
Read | Uncompress a block of bytes from the current zip entry and writes the data in a given buffer.
Reset | Move to just before the first entry in the zip directory.
Seek | Seek to the specified entry.
ToString (inherited from System.Object) | Select the method name to go to the Microsoft documentation.

Protected Instance Methods

Finalize | Cleans up the resources used by this zip file.
MemberwiseClone (inherited from System.Object) | Select the method name to go to the Microsoft documentation.

See Also

ZipReader Class | OrganicBit.Zip Namespace


ZipReader Constructor

Initializes a instance of the ZipReader class for reading the zip file with the given name.

public ZipReader(
   string fileName
);

Parameters

fileName

The name of zip file that will be read.

See Also

ZipReader Class | ZipReader Members | OrganicBit.Zip Namespace


ZipReader Properties

The properties of the ZipReader class are listed below. For a complete list of ZipReader class members, see the ZipReader Members topic.

Public Instance Properties

Comment | Gets the global comment for the zip file.
Current | Gets the current entry in the zip file..
Entries | Gets a ZipEntryCollection object that contains all the entries in the zip file directory.
Name | Gets the name of the zip file that was passed to the constructor.

See Also

ZipReader Class | OrganicBit.Zip Namespace


ZipReader.Comment Property

Gets the global comment for the zip file.

public string Comment {get;}

See Also

ZipReader Class | ZipReader Members | OrganicBit.Zip Namespace


ZipReader.Current Property

Gets the current entry in the zip file..

public ZipEntry Current {get;}

See Also

ZipReader Class | ZipReader Members | OrganicBit.Zip Namespace


ZipReader.Entries Property

Gets a ZipEntryCollection object that contains all the entries in the zip file directory.

public ZipEntryCollection Entries {get;}

See Also

ZipReader Class | ZipReader Members | OrganicBit.Zip Namespace


ZipReader.Name Property

Gets the name of the zip file that was passed to the constructor.

public string Name {get;}

See Also

ZipReader Class | ZipReader Members | OrganicBit.Zip Namespace


ZipReader Methods

The methods of the ZipReader class are listed below. For a complete list of ZipReader class members, see the ZipReader Members topic.

Public Instance Methods

Close | Closes the zip file and releases any resources.
Equals (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
MoveNext | Advances the enumerator to the next element of the collection.Sets Current to the next zip entry.
Read | Uncompress a block of bytes from the current zip entry and writes the data in a given buffer.
Reset | Move to just before the first entry in the zip directory.
Seek | Seek to the specified entry.
ToString (inherited from System.Object) | Select the method name to go to the Microsoft documentation.

Protected Instance Methods

Finalize | Cleans up the resources used by this zip file.
MemberwiseClone (inherited from System.Object) | Select the method name to go to the Microsoft documentation.

See Also

ZipReader Class | OrganicBit.Zip Namespace


ZipReader.Close Method

Closes the zip file and releases any resources.

public void Close();

See Also

ZipReader Class | ZipReader Members | OrganicBit.Zip Namespace


ZipReader.Finalize Method

Cleans up the resources used by this zip file.

protected override void Finalize();

See Also

ZipReader Class | ZipReader Members | OrganicBit.Zip Namespace


ZipReader.MoveNext Method

Advances the enumerator to the next element of the collection.Sets Current to the next zip entry.

public final bool MoveNext();

Return Value

true if the next entry is not null; otherwise false.

See Also

ZipReader Class | ZipReader Members | OrganicBit.Zip Namespace


ZipReader.Read Method

Uncompress a block of bytes from the current zip entry and writes the data in a given buffer.

public int Read(
   byte[] buffer,
   int index,
   int count
);

Parameters

buffer

The array to write data into.

index

The byte offset in at which to begin writing.

count

The maximum number of bytes to read.

See Also

ZipReader Class | ZipReader Members | OrganicBit.Zip Namespace


ZipReader.Reset Method

Move to just before the first entry in the zip directory.

public final void Reset();

See Also

ZipReader Class | ZipReader Members | OrganicBit.Zip Namespace


ZipReader.Seek Method

Seek to the specified entry.

public void Seek(
   string entryName
);

Parameters

entryName

The name of the entry to seek to.

See Also

ZipReader Class | ZipReader Members | OrganicBit.Zip Namespace


ZipWriter Class

Provides support for writing files in the ZIP file format. Includes support for both compressed and uncompressed entries.

System.Object
ZipWriter

public class ZipWriter : IDisposable

Example

This example shows how to create a ZIP file.

            public static void Add(string zipFileName, string[] entryPatterns) {
                string currentDirectory = Directory.GetCurrentDirectory();
                Console.WriteLine("Creating {0}", zipFileName);

                ZipWriter writer = new ZipWriter(zipFileName);

                // buffer to hold temp bytes
                byte[] buffer = new byte[4096];
                int byteCount;

                // add files to archive
                foreach (string pattern in entryPatterns) {
                    foreach (string path in Directory.GetFiles(currentDirectory, pattern)) {
                        string fileName = Path.GetFileName(path);
                        Console.Write("Adding {0}", fileName);

                        ZipEntry entry = new ZipEntry(fileName);
                        entry.ModifiedTime = File.GetLastWriteTime(fileName);
                        entry.Comment = "local file comment";

                        writer.AddEntry(entry);

                        FileStream reader = File.OpenRead(entry.Name);
                        while ((byteCount = reader.Read(buffer, 0, buffer.Length)) > 0) {
                            Console.Write(".");
                            writer.Write(buffer, 0, byteCount);
                        }
                        reader.Close();
                        Console.WriteLine();
                    }
                }

                writer.Close();
            }

Requirements

Namespace: OrganicBit.Zip Namespace

Assembly: Zip.dll

See Also

ZipWriter Members | OrganicBit.Zip Namespace


ZipWriter Members

Public Instance Constructors

ZipWriter Constructor Initializes a new instance fo the ZipWriter class with a specified file name. Any Existing file will be overwritten.

Public Instance Properties

Comment | Gets and sets the zip file comment.
Name | Gets the name of the zip file.

Public Instance Methods

AddEntry | Creates a new zip entry in the directory and positions the stream to the start of the entry data.
Close | Closes the zip file and releases any resources.
Equals (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
Write | Compress a block of bytes from the given buffer and writes them into the current zip entry.

Protected Instance Methods

Finalize | Cleans up the resources used by this zip file.
MemberwiseClone (inherited from System.Object) | Select the method name to go to the Microsoft documentation.

See Also

ZipWriter Class | OrganicBit.Zip Namespace


ZipWriter Constructor

Initializes a new instance fo the ZipWriter class with a specified file name. Any Existing file will be overwritten.

public ZipWriter(
   string fileName
);

Parameters

fileName

The name of the zip file to create.

See Also

ZipWriter Class | ZipWriter Members | OrganicBit.Zip Namespace


ZipWriter Properties

The properties of the ZipWriter class are listed below. For a complete list of ZipWriter class members, see the ZipWriter Members topic.

Public Instance Properties

Comment | Gets and sets the zip file comment.
Name | Gets the name of the zip file.

See Also

ZipWriter Class | OrganicBit.Zip Namespace


ZipWriter.Comment Property

Gets and sets the zip file comment.

public string Comment {get; set;}

See Also

ZipWriter Class | ZipWriter Members | OrganicBit.Zip Namespace


ZipWriter.Name Property

Gets the name of the zip file.

public string Name {get;}

See Also

ZipWriter Class | ZipWriter Members | OrganicBit.Zip Namespace


ZipWriter Methods

The methods of the ZipWriter class are listed below. For a complete list of ZipWriter class members, see the ZipWriter Members topic.

Public Instance Methods

AddEntry | Creates a new zip entry in the directory and positions the stream to the start of the entry data.
Close | Closes the zip file and releases any resources.
Equals (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from System.Object) | Select the method name to go to the Microsoft documentation.
Write | Compress a block of bytes from the given buffer and writes them into the current zip entry.

Protected Instance Methods

Finalize | Cleans up the resources used by this zip file.
MemberwiseClone (inherited from System.Object) | Select the method name to go to the Microsoft documentation.

See Also

ZipWriter Class | OrganicBit.Zip Namespace


ZipWriter.AddEntry Method

Creates a new zip entry in the directory and positions the stream to the start of the entry data.

public void AddEntry(
   ZipEntry entry
);

Parameters

entry

The zip entry to be written.

Remarks

Closes the current entry if still active.

See Also

ZipWriter Class | ZipWriter Members | OrganicBit.Zip Namespace


ZipWriter.Close Method

Closes the zip file and releases any resources.

public void Close();

See Also

ZipWriter Class | ZipWriter Members | OrganicBit.Zip Namespace


ZipWriter.Finalize Method

Cleans up the resources used by this zip file.

protected override void Finalize();

See Also

ZipWriter Class | ZipWriter Members | OrganicBit.Zip Namespace


ZipWriter.Write Method

Compress a block of bytes from the given buffer and writes them into the current zip entry.

public void Write(
   byte[] buffer,
   int index,
   int count
);

Parameters

buffer

The array to read data from.

index

The byte offset in at which to begin reading.

count

The maximum number of bytes to write.

See Also

ZipWriter Class | ZipWriter Members | OrganicBit.Zip Namespace


OrganicBit.ZipHierarchy

DOC.NET Documented Class Library

OrganicBit.Zip Hierarchy

System.Object
-System.Collections.CollectionBase
-ZipEntryCollection
-System.Exception
-System.ApplicationException
-ZipException
-ZipEntry
-ZipEntryCollection.ZipEntryEnumerator
-ZipReader
-ZipWriter