Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions src/ICSharpCode.SharpZipLib/Zip/ZipFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,23 @@ private bool HaveKeys

#region Constructors

/// <summary>
/// Opens a Zip file with the given name for reading.
/// </summary>
/// <param name="name">The name of the file to open.</param>
/// <exception cref="ArgumentNullException">The argument supplied is null.</exception>
/// <exception cref="IOException">
/// An i/o error occurs
/// </exception>
/// <exception cref="ZipException">
/// The file doesn't contain a valid zip archive.
/// </exception>
public ZipFile(string name) :
this(name, null)
{

}

/// <summary>
/// Opens a Zip file with the given name for reading.
/// </summary>
Expand All @@ -399,7 +416,7 @@ private bool HaveKeys
/// <exception cref="ZipException">
/// The file doesn't contain a valid zip archive.
/// </exception>
public ZipFile(string name, StringCodec stringCodec = null)
public ZipFile(string name, StringCodec stringCodec)
{
name_ = name ?? throw new ArgumentNullException(nameof(name));

Expand Down Expand Up @@ -500,6 +517,29 @@ public ZipFile(Stream stream) :

}

/// <summary>
/// Opens a Zip file reading the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to read archive data from.</param>
/// <param name="leaveOpen">true to leave the <see cref="Stream">stream</see> open when the ZipFile is disposed, false to dispose of it</param>
/// <exception cref="IOException">
/// An i/o error occurs
/// </exception>
/// <exception cref="ZipException">
/// The stream doesn't contain a valid zip archive.<br/>
/// </exception>
/// <exception cref="ArgumentException">
/// The <see cref="Stream">stream</see> doesnt support seeking.
/// </exception>
/// <exception cref="ArgumentNullException">
/// The <see cref="Stream">stream</see> argument is null.
/// </exception>
public ZipFile(Stream stream, bool leaveOpen) :
this(stream, leaveOpen, null)
{

}

/// <summary>
/// Opens a Zip file reading the given <see cref="Stream"/>.
/// </summary>
Expand All @@ -518,7 +558,7 @@ public ZipFile(Stream stream) :
/// <exception cref="ArgumentNullException">
/// The <see cref="Stream">stream</see> argument is null.
/// </exception>
public ZipFile(Stream stream, bool leaveOpen, StringCodec stringCodec = null)
public ZipFile(Stream stream, bool leaveOpen, StringCodec stringCodec)
{
if (stream == null)
{
Expand Down