Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
afcccb0
Merge PR #323: Fix ZipOutputStream.CloseEntry for AES encrypted Store…
Numpsy Mar 4, 2019
43fd81e
Merge PR #325: Ability to mimic a zip file created by a Linux file-sy…
bjorg Jun 15, 2019
1c3f459
Merge PR #336: Treat empty string as no RootPath in TarArchive
iUnknwn Jun 15, 2019
98bbdda
Merge PR #331: Change ZipAESStream to handle reads of less data than …
Numpsy Jun 15, 2019
1a12d9c
Merge PR #330: Add a benchmarks project using BenchmarkDotNet
Numpsy Jun 15, 2019
88cfaa6
Merge PR #225: Fix flushing of GZipOutputStream
adamreeve Jun 15, 2019
5d02051
Merge PR #350: Add tests and overload for ZipEntry.HostSystem
piksel Jun 15, 2019
5cca93d
Merge PR #329: Do not set the StrongEncryption flag for WinZipAes enc…
Numpsy Jun 15, 2019
27ac139
Merge PR #352: Change ZipInputStream.GetNextEntry to set the entry co…
Numpsy Jun 15, 2019
f03a2ef
Merge PR #354: Add LZMA and PPMd to the CompressionMethod enum
Numpsy Jun 16, 2019
6f245b3
Merge PR #326: Dispose TarArchive output streams in case of an exception
Numpsy Jun 18, 2019
1435683
Merge PR #359: Update test sdk and nunit packages to the curent versions
Numpsy Jun 20, 2019
34d7472
Merge PR #371: Add test for GZip with small buffer
piksel Aug 6, 2019
ffe5115
Merge PR #363: Change ZipFile.ReadEntries to always look for the Zip6…
Numpsy Aug 8, 2019
36ece7a
Merge PR #369: Make the custom exception types serializable
Numpsy Aug 8, 2019
805dd79
Merge PR #372: Remove invalid exception and handle 0 reads
piksel Aug 9, 2019
56cbe99
Update csproj for v1.2
piksel Aug 9, 2019
414b8c1
Merge PR #374: Update Docs generation
piksel Aug 11, 2019
ab7f8c5
Fix API docs styling
piksel Aug 11, 2019
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,4 @@ paket-files/
*.sln.iml
/test/ICSharpCode.SharpZipLib.TestBootstrapper/Properties/launchSettings.json
_testRunner/
docs/help/api/.manifest
15 changes: 12 additions & 3 deletions ICSharpCode.SharpZipLib.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.9
# Visual Studio Version 16
VisualStudioVersion = 16.0.28705.295
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Configuration", "Solution Configuration", "{F1097E98-4DEB-4A0A-81EE-5CEC667EBDF0}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -15,7 +15,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.SharpZipLib", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.SharpZipLib.Tests", "test\ICSharpCode.SharpZipLib.Tests\ICSharpCode.SharpZipLib.Tests.csproj", "{82211166-9C45-4603-8E3A-2CA2EFFCBC26}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZipLib.TestBootstrapper", "test\ICSharpCode.SharpZipLib.TestBootstrapper\ICSharpCode.SharpZipLib.TestBootstrapper.csproj", "{535D7365-C5B1-4253-9233-D72D972CA851}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.SharpZipLib.TestBootstrapper", "test\ICSharpCode.SharpZipLib.TestBootstrapper\ICSharpCode.SharpZipLib.TestBootstrapper.csproj", "{535D7365-C5B1-4253-9233-D72D972CA851}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.SharpZipLib.Benchmark", "benchmark\ICSharpCode.SharpZipLib.Benchmark\ICSharpCode.SharpZipLib.Benchmark.csproj", "{C51E638B-DDD0-48B6-A6BD-EBC4E6A104C7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -35,8 +37,15 @@ Global
{535D7365-C5B1-4253-9233-D72D972CA851}.Debug|Any CPU.Build.0 = Debug|Any CPU
{535D7365-C5B1-4253-9233-D72D972CA851}.Release|Any CPU.ActiveCfg = Release|Any CPU
{535D7365-C5B1-4253-9233-D72D972CA851}.Release|Any CPU.Build.0 = Release|Any CPU
{C51E638B-DDD0-48B6-A6BD-EBC4E6A104C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C51E638B-DDD0-48B6-A6BD-EBC4E6A104C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C51E638B-DDD0-48B6-A6BD-EBC4E6A104C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C51E638B-DDD0-48B6-A6BD-EBC4E6A104C7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0A049193-65F8-49AF-82CB-75D42563DA16}
EndGlobalSection
EndGlobal
9 changes: 8 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@ nuget:
disable_publish_on_pr: true
before_build:
- ps: nuget restore ICSharpCode.SharpZipLib.sln
- ps: .\tools\appveyor-docfx-init.ps1
build:
project: ICSharpCode.SharpZipLib.sln
publish_nuget: true
publish_nuget_symbols: true
verbosity: normal
after_build:
- ps: .\tools\appveyor-docfx-build.ps1
test_script:
- ps: tools/appveyor-test.ps1
- ps: tools\appveyor-test.ps1
artifacts:
- path: docs\help\_site
type: zip
name: Documentation
44 changes: 44 additions & 0 deletions benchmark/ICSharpCode.SharpZipLib.Benchmark/Checksum/Adler32.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System;
using BenchmarkDotNet.Attributes;

namespace ICSharpCode.SharpZipLib.Benchmark.Checksum
{
[Config(typeof(MultipleRuntimes))]
public class Adler32
{
private const int ChunkCount = 256;
private const int ChunkSize = 1024 * 1024;
private const int N = ChunkCount * ChunkSize;
private readonly byte[] data;

public Adler32()
{
data = new byte[N];
new Random(1).NextBytes(data);
}

[Benchmark]
public long Adler32LargeUpdate()
{
var adler32 = new ICSharpCode.SharpZipLib.Checksum.Adler32();
adler32.Update(data);
return adler32.Value;
}

/*
[Benchmark]
public long Adler32ChunkedUpdate()
{
var adler32 = new ICSharpCode.SharpZipLib.Checksum.Adler32();

for (int i = 0; i < ChunkCount; i++)
{
var segment = new ArraySegment<byte>(data, ChunkSize * i, ChunkSize);
adler32.Update(segment);
}

return adler32.Value;
}
*/
}
}
44 changes: 44 additions & 0 deletions benchmark/ICSharpCode.SharpZipLib.Benchmark/Checksum/BZip2Crc.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System;
using BenchmarkDotNet.Attributes;

namespace ICSharpCode.SharpZipLib.Benchmark.Checksum
{
[Config(typeof(MultipleRuntimes))]
public class BZip2Crc
{
private const int ChunkCount = 256;
private const int ChunkSize = 1024 * 1024;
private const int N = ChunkCount * ChunkSize;
private readonly byte[] data;

public BZip2Crc()
{
data = new byte[N];
new Random(1).NextBytes(data);
}

[Benchmark]
public long BZip2CrcLargeUpdate()
{
var bzipCrc = new ICSharpCode.SharpZipLib.Checksum.BZip2Crc();
bzipCrc.Update(data);
return bzipCrc.Value;
}

/*
[Benchmark]
public long BZip2CrcChunkedUpdate()
{
var bzipCrc = new ICSharpCode.SharpZipLib.Checksum.BZip2Crc();

for (int i = 0; i < ChunkCount; i++)
{
var segment = new ArraySegment<byte>(data, ChunkSize * i, ChunkSize);
bzipCrc.Update(segment);
}

return bzipCrc.Value;
}
*/
}
}
44 changes: 44 additions & 0 deletions benchmark/ICSharpCode.SharpZipLib.Benchmark/Checksum/Crc32.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System;
using BenchmarkDotNet.Attributes;

namespace ICSharpCode.SharpZipLib.Benchmark.Checksum
{
[Config(typeof(MultipleRuntimes))]
public class Crc32
{
private const int ChunkCount = 256;
private const int ChunkSize = 1024 * 1024;
private const int N = ChunkCount * ChunkSize;
private readonly byte[] data;

public Crc32()
{
data = new byte[N];
new Random(1).NextBytes(data);
}

[Benchmark]
public long Crc32LargeUpdate()
{
var crc32 = new ICSharpCode.SharpZipLib.Checksum.Crc32();
crc32.Update(data);
return crc32.Value;
}

/*
[Benchmark]
public long Crc32ChunkedUpdate()
{
var crc32 = new ICSharpCode.SharpZipLib.Checksum.Crc32();

for (int i = 0; i < ChunkCount; i++)
{
var segment = new ArraySegment<byte>(data, ChunkSize * i, ChunkSize);
crc32.Update(segment);
}

return crc32.Value;
}
*/
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet">
<Version>0.11.4</Version>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\ICSharpCode.SharpZipLib\ICSharpCode.SharpZipLib.csproj" />
</ItemGroup>

</Project>
27 changes: 27 additions & 0 deletions benchmark/ICSharpCode.SharpZipLib.Benchmark/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using BenchmarkDotNet;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Toolchains.CsProj;

namespace ICSharpCode.SharpZipLib.Benchmark
{
public class MultipleRuntimes : ManualConfig
{
public MultipleRuntimes()
{
Add(Job.Default.With(CsProjClassicNetToolchain.Net461).AsBaseline()); // NET 4.6.1
Add(Job.Default.With(CsProjCoreToolchain.NetCoreApp21)); // .NET Core 2.1
//Add(Job.Default.With(CsProjCoreToolchain.NetCoreApp30)); // .NET Core 3.0
}
}

class Program
{
static void Main(string[] args)
{
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
}
}
}
56 changes: 56 additions & 0 deletions benchmark/ICSharpCode.SharpZipLib.Benchmark/Zip/ZipInputStream.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System;
using System.IO;
using BenchmarkDotNet.Attributes;

namespace ICSharpCode.SharpZipLib.Benchmark.Zip
{
[Config(typeof(MultipleRuntimes))]
public class ZipInputStream
{
private const int ChunkCount = 64;
private const int ChunkSize = 1024 * 1024;
private const int N = ChunkCount * ChunkSize;

byte[] zippedData;

public ZipInputStream()
{
using (var memoryStream = new MemoryStream())
{
using (var zipOutputStream = new SharpZipLib.Zip.ZipOutputStream(memoryStream))
{
zipOutputStream.PutNextEntry(new SharpZipLib.Zip.ZipEntry("0"));

var inputBuffer = new byte[ChunkSize];

for (int i = 0; i < ChunkCount; i++)
{
zipOutputStream.Write(inputBuffer, 0, inputBuffer.Length);
}
}

zippedData = memoryStream.ToArray();
}
}

[Benchmark]
public long ReadZipInputStream()
{
using (var memoryStream = new MemoryStream(zippedData))
{
using (var zipInputStream = new SharpZipLib.Zip.ZipInputStream(memoryStream))
{
var buffer = new byte[4096];
var entry = zipInputStream.GetNextEntry();

while (zipInputStream.Read(buffer, 0, buffer.Length) > 0)
{

}

return entry.Size;
}
}
}
}
}
40 changes: 40 additions & 0 deletions benchmark/ICSharpCode.SharpZipLib.Benchmark/Zip/ZipOutputStream.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using System.IO;
using BenchmarkDotNet.Attributes;

namespace ICSharpCode.SharpZipLib.Benchmark.Zip
{
[Config(typeof(MultipleRuntimes))]
public class ZipOutputStream
{
private const int ChunkCount = 64;
private const int ChunkSize = 1024 * 1024;
private const int N = ChunkCount * ChunkSize;

byte[] outputBuffer;
byte[] inputBuffer;

public ZipOutputStream()
{
inputBuffer = new byte[ChunkSize];
outputBuffer = new byte[N];
}

[Benchmark]
public long WriteZipOutputStream()
{
using (var memoryStream = new MemoryStream(outputBuffer))
{
var zipOutputStream = new SharpZipLib.Zip.ZipOutputStream(memoryStream);
zipOutputStream.PutNextEntry(new SharpZipLib.Zip.ZipEntry("0"));

for (int i = 0; i < ChunkCount; i++)
{
zipOutputStream.Write(inputBuffer, 0, inputBuffer.Length);
}

return memoryStream.Position;
}
}
}
}
14 changes: 14 additions & 0 deletions docs/help/api/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
items:
- uid: ICSharpCode.SharpZipLib.SharpZipBaseException
name: SharpZipBaseException
- uid: ICSharpCode.SharpZipLib.StreamDecodingException
name: StreamDecodingException
- uid: ICSharpCode.SharpZipLib.StreamUnsupportedException
name: StreamUnsupportedException
- uid: ICSharpCode.SharpZipLib.UnexpectedEndOfStreamException
name: UnexpectedEndOfStreamException
- uid: ICSharpCode.SharpZipLib.ValueOutOfRangeException
name: ValueOutOfRangeException
- uid: ICSharpCode.SharpZipLib.BZip2
name: ICSharpCode.SharpZipLib.BZip2
items:
Expand Down Expand Up @@ -43,6 +51,8 @@
name: FileSystemScanner
- uid: ICSharpCode.SharpZipLib.Core.INameTransform
name: INameTransform
- uid: ICSharpCode.SharpZipLib.Core.InvalidNameException
name: InvalidNameException
- uid: ICSharpCode.SharpZipLib.Core.IScanFilter
name: IScanFilter
- uid: ICSharpCode.SharpZipLib.Core.NameAndSizeFilter
Expand Down Expand Up @@ -109,6 +119,8 @@
name: TarEntry
- uid: ICSharpCode.SharpZipLib.Tar.TarException
name: TarException
- uid: ICSharpCode.SharpZipLib.Tar.TarExtendedHeaderReader
name: TarExtendedHeaderReader
- uid: ICSharpCode.SharpZipLib.Tar.TarHeader
name: TarHeader
- uid: ICSharpCode.SharpZipLib.Tar.TarInputStream
Expand Down Expand Up @@ -204,6 +216,8 @@
name: ZipNameTransform
- uid: ICSharpCode.SharpZipLib.Zip.ZipOutputStream
name: ZipOutputStream
- uid: ICSharpCode.SharpZipLib.Zip.ZipStrings
name: ZipStrings
- uid: ICSharpCode.SharpZipLib.Zip.ZipTestResultHandler
name: ZipTestResultHandler
- uid: ICSharpCode.SharpZipLib.Zip.Compression
Expand Down
Loading