Skip to content

Commit d9f7fc1

Browse files
committed
2 parents 118750b + ab7f8c5 commit d9f7fc1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1270
-116
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,4 @@ paket-files/
252252
*.sln.iml
253253
/test/ICSharpCode.SharpZipLib.TestBootstrapper/Properties/launchSettings.json
254254
_testRunner/
255+
docs/help/api/.manifest

ICSharpCode.SharpZipLib.sln

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26228.9
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.28705.295
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Configuration", "Solution Configuration", "{F1097E98-4DEB-4A0A-81EE-5CEC667EBDF0}"
77
ProjectSection(SolutionItems) = preProject
@@ -15,7 +15,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.SharpZipLib", "
1515
EndProject
1616
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.SharpZipLib.Tests", "test\ICSharpCode.SharpZipLib.Tests\ICSharpCode.SharpZipLib.Tests.csproj", "{82211166-9C45-4603-8E3A-2CA2EFFCBC26}"
1717
EndProject
18-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZipLib.TestBootstrapper", "test\ICSharpCode.SharpZipLib.TestBootstrapper\ICSharpCode.SharpZipLib.TestBootstrapper.csproj", "{535D7365-C5B1-4253-9233-D72D972CA851}"
18+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.SharpZipLib.TestBootstrapper", "test\ICSharpCode.SharpZipLib.TestBootstrapper\ICSharpCode.SharpZipLib.TestBootstrapper.csproj", "{535D7365-C5B1-4253-9233-D72D972CA851}"
19+
EndProject
20+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.SharpZipLib.Benchmark", "benchmark\ICSharpCode.SharpZipLib.Benchmark\ICSharpCode.SharpZipLib.Benchmark.csproj", "{C51E638B-DDD0-48B6-A6BD-EBC4E6A104C7}"
1921
EndProject
2022
Global
2123
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -35,8 +37,15 @@ Global
3537
{535D7365-C5B1-4253-9233-D72D972CA851}.Debug|Any CPU.Build.0 = Debug|Any CPU
3638
{535D7365-C5B1-4253-9233-D72D972CA851}.Release|Any CPU.ActiveCfg = Release|Any CPU
3739
{535D7365-C5B1-4253-9233-D72D972CA851}.Release|Any CPU.Build.0 = Release|Any CPU
40+
{C51E638B-DDD0-48B6-A6BD-EBC4E6A104C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41+
{C51E638B-DDD0-48B6-A6BD-EBC4E6A104C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
42+
{C51E638B-DDD0-48B6-A6BD-EBC4E6A104C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
43+
{C51E638B-DDD0-48B6-A6BD-EBC4E6A104C7}.Release|Any CPU.Build.0 = Release|Any CPU
3844
EndGlobalSection
3945
GlobalSection(SolutionProperties) = preSolution
4046
HideSolutionNode = FALSE
4147
EndGlobalSection
48+
GlobalSection(ExtensibilityGlobals) = postSolution
49+
SolutionGuid = {0A049193-65F8-49AF-82CB-75D42563DA16}
50+
EndGlobalSection
4251
EndGlobal

appveyor.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,17 @@ nuget:
1818
disable_publish_on_pr: true
1919
before_build:
2020
- ps: nuget restore ICSharpCode.SharpZipLib.sln
21+
- ps: .\tools\appveyor-docfx-init.ps1
2122
build:
2223
project: ICSharpCode.SharpZipLib.sln
2324
publish_nuget: true
2425
publish_nuget_symbols: true
2526
verbosity: normal
27+
after_build:
28+
- ps: .\tools\appveyor-docfx-build.ps1
2629
test_script:
27-
- ps: tools/appveyor-test.ps1
30+
- ps: tools\appveyor-test.ps1
31+
artifacts:
32+
- path: docs\help\_site
33+
type: zip
34+
name: Documentation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using System;
2+
using BenchmarkDotNet.Attributes;
3+
4+
namespace ICSharpCode.SharpZipLib.Benchmark.Checksum
5+
{
6+
[Config(typeof(MultipleRuntimes))]
7+
public class Adler32
8+
{
9+
private const int ChunkCount = 256;
10+
private const int ChunkSize = 1024 * 1024;
11+
private const int N = ChunkCount * ChunkSize;
12+
private readonly byte[] data;
13+
14+
public Adler32()
15+
{
16+
data = new byte[N];
17+
new Random(1).NextBytes(data);
18+
}
19+
20+
[Benchmark]
21+
public long Adler32LargeUpdate()
22+
{
23+
var adler32 = new ICSharpCode.SharpZipLib.Checksum.Adler32();
24+
adler32.Update(data);
25+
return adler32.Value;
26+
}
27+
28+
/*
29+
[Benchmark]
30+
public long Adler32ChunkedUpdate()
31+
{
32+
var adler32 = new ICSharpCode.SharpZipLib.Checksum.Adler32();
33+
34+
for (int i = 0; i < ChunkCount; i++)
35+
{
36+
var segment = new ArraySegment<byte>(data, ChunkSize * i, ChunkSize);
37+
adler32.Update(segment);
38+
}
39+
40+
return adler32.Value;
41+
}
42+
*/
43+
}
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using System;
2+
using BenchmarkDotNet.Attributes;
3+
4+
namespace ICSharpCode.SharpZipLib.Benchmark.Checksum
5+
{
6+
[Config(typeof(MultipleRuntimes))]
7+
public class BZip2Crc
8+
{
9+
private const int ChunkCount = 256;
10+
private const int ChunkSize = 1024 * 1024;
11+
private const int N = ChunkCount * ChunkSize;
12+
private readonly byte[] data;
13+
14+
public BZip2Crc()
15+
{
16+
data = new byte[N];
17+
new Random(1).NextBytes(data);
18+
}
19+
20+
[Benchmark]
21+
public long BZip2CrcLargeUpdate()
22+
{
23+
var bzipCrc = new ICSharpCode.SharpZipLib.Checksum.BZip2Crc();
24+
bzipCrc.Update(data);
25+
return bzipCrc.Value;
26+
}
27+
28+
/*
29+
[Benchmark]
30+
public long BZip2CrcChunkedUpdate()
31+
{
32+
var bzipCrc = new ICSharpCode.SharpZipLib.Checksum.BZip2Crc();
33+
34+
for (int i = 0; i < ChunkCount; i++)
35+
{
36+
var segment = new ArraySegment<byte>(data, ChunkSize * i, ChunkSize);
37+
bzipCrc.Update(segment);
38+
}
39+
40+
return bzipCrc.Value;
41+
}
42+
*/
43+
}
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using System;
2+
using BenchmarkDotNet.Attributes;
3+
4+
namespace ICSharpCode.SharpZipLib.Benchmark.Checksum
5+
{
6+
[Config(typeof(MultipleRuntimes))]
7+
public class Crc32
8+
{
9+
private const int ChunkCount = 256;
10+
private const int ChunkSize = 1024 * 1024;
11+
private const int N = ChunkCount * ChunkSize;
12+
private readonly byte[] data;
13+
14+
public Crc32()
15+
{
16+
data = new byte[N];
17+
new Random(1).NextBytes(data);
18+
}
19+
20+
[Benchmark]
21+
public long Crc32LargeUpdate()
22+
{
23+
var crc32 = new ICSharpCode.SharpZipLib.Checksum.Crc32();
24+
crc32.Update(data);
25+
return crc32.Value;
26+
}
27+
28+
/*
29+
[Benchmark]
30+
public long Crc32ChunkedUpdate()
31+
{
32+
var crc32 = new ICSharpCode.SharpZipLib.Checksum.Crc32();
33+
34+
for (int i = 0; i < ChunkCount; i++)
35+
{
36+
var segment = new ArraySegment<byte>(data, ChunkSize * i, ChunkSize);
37+
crc32.Update(segment);
38+
}
39+
40+
return crc32.Value;
41+
}
42+
*/
43+
}
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="BenchmarkDotNet">
10+
<Version>0.11.4</Version>
11+
</PackageReference>
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<ProjectReference Include="..\..\src\ICSharpCode.SharpZipLib\ICSharpCode.SharpZipLib.csproj" />
16+
</ItemGroup>
17+
18+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
using BenchmarkDotNet;
3+
using BenchmarkDotNet.Configs;
4+
using BenchmarkDotNet.Jobs;
5+
using BenchmarkDotNet.Running;
6+
using BenchmarkDotNet.Toolchains.CsProj;
7+
8+
namespace ICSharpCode.SharpZipLib.Benchmark
9+
{
10+
public class MultipleRuntimes : ManualConfig
11+
{
12+
public MultipleRuntimes()
13+
{
14+
Add(Job.Default.With(CsProjClassicNetToolchain.Net461).AsBaseline()); // NET 4.6.1
15+
Add(Job.Default.With(CsProjCoreToolchain.NetCoreApp21)); // .NET Core 2.1
16+
//Add(Job.Default.With(CsProjCoreToolchain.NetCoreApp30)); // .NET Core 3.0
17+
}
18+
}
19+
20+
class Program
21+
{
22+
static void Main(string[] args)
23+
{
24+
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
25+
}
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
using System;
2+
using System.IO;
3+
using BenchmarkDotNet.Attributes;
4+
5+
namespace ICSharpCode.SharpZipLib.Benchmark.Zip
6+
{
7+
[Config(typeof(MultipleRuntimes))]
8+
public class ZipInputStream
9+
{
10+
private const int ChunkCount = 64;
11+
private const int ChunkSize = 1024 * 1024;
12+
private const int N = ChunkCount * ChunkSize;
13+
14+
byte[] zippedData;
15+
16+
public ZipInputStream()
17+
{
18+
using (var memoryStream = new MemoryStream())
19+
{
20+
using (var zipOutputStream = new SharpZipLib.Zip.ZipOutputStream(memoryStream))
21+
{
22+
zipOutputStream.PutNextEntry(new SharpZipLib.Zip.ZipEntry("0"));
23+
24+
var inputBuffer = new byte[ChunkSize];
25+
26+
for (int i = 0; i < ChunkCount; i++)
27+
{
28+
zipOutputStream.Write(inputBuffer, 0, inputBuffer.Length);
29+
}
30+
}
31+
32+
zippedData = memoryStream.ToArray();
33+
}
34+
}
35+
36+
[Benchmark]
37+
public long ReadZipInputStream()
38+
{
39+
using (var memoryStream = new MemoryStream(zippedData))
40+
{
41+
using (var zipInputStream = new SharpZipLib.Zip.ZipInputStream(memoryStream))
42+
{
43+
var buffer = new byte[4096];
44+
var entry = zipInputStream.GetNextEntry();
45+
46+
while (zipInputStream.Read(buffer, 0, buffer.Length) > 0)
47+
{
48+
49+
}
50+
51+
return entry.Size;
52+
}
53+
}
54+
}
55+
}
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using System;
2+
using System.IO;
3+
using BenchmarkDotNet.Attributes;
4+
5+
namespace ICSharpCode.SharpZipLib.Benchmark.Zip
6+
{
7+
[Config(typeof(MultipleRuntimes))]
8+
public class ZipOutputStream
9+
{
10+
private const int ChunkCount = 64;
11+
private const int ChunkSize = 1024 * 1024;
12+
private const int N = ChunkCount * ChunkSize;
13+
14+
byte[] outputBuffer;
15+
byte[] inputBuffer;
16+
17+
public ZipOutputStream()
18+
{
19+
inputBuffer = new byte[ChunkSize];
20+
outputBuffer = new byte[N];
21+
}
22+
23+
[Benchmark]
24+
public long WriteZipOutputStream()
25+
{
26+
using (var memoryStream = new MemoryStream(outputBuffer))
27+
{
28+
var zipOutputStream = new SharpZipLib.Zip.ZipOutputStream(memoryStream);
29+
zipOutputStream.PutNextEntry(new SharpZipLib.Zip.ZipEntry("0"));
30+
31+
for (int i = 0; i < ChunkCount; i++)
32+
{
33+
zipOutputStream.Write(inputBuffer, 0, inputBuffer.Length);
34+
}
35+
36+
return memoryStream.Position;
37+
}
38+
}
39+
}
40+
}

docs/help/api/toc.yml

+14
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
items:
55
- uid: ICSharpCode.SharpZipLib.SharpZipBaseException
66
name: SharpZipBaseException
7+
- uid: ICSharpCode.SharpZipLib.StreamDecodingException
8+
name: StreamDecodingException
9+
- uid: ICSharpCode.SharpZipLib.StreamUnsupportedException
10+
name: StreamUnsupportedException
11+
- uid: ICSharpCode.SharpZipLib.UnexpectedEndOfStreamException
12+
name: UnexpectedEndOfStreamException
13+
- uid: ICSharpCode.SharpZipLib.ValueOutOfRangeException
14+
name: ValueOutOfRangeException
715
- uid: ICSharpCode.SharpZipLib.BZip2
816
name: ICSharpCode.SharpZipLib.BZip2
917
items:
@@ -43,6 +51,8 @@
4351
name: FileSystemScanner
4452
- uid: ICSharpCode.SharpZipLib.Core.INameTransform
4553
name: INameTransform
54+
- uid: ICSharpCode.SharpZipLib.Core.InvalidNameException
55+
name: InvalidNameException
4656
- uid: ICSharpCode.SharpZipLib.Core.IScanFilter
4757
name: IScanFilter
4858
- uid: ICSharpCode.SharpZipLib.Core.NameAndSizeFilter
@@ -109,6 +119,8 @@
109119
name: TarEntry
110120
- uid: ICSharpCode.SharpZipLib.Tar.TarException
111121
name: TarException
122+
- uid: ICSharpCode.SharpZipLib.Tar.TarExtendedHeaderReader
123+
name: TarExtendedHeaderReader
112124
- uid: ICSharpCode.SharpZipLib.Tar.TarHeader
113125
name: TarHeader
114126
- uid: ICSharpCode.SharpZipLib.Tar.TarInputStream
@@ -204,6 +216,8 @@
204216
name: ZipNameTransform
205217
- uid: ICSharpCode.SharpZipLib.Zip.ZipOutputStream
206218
name: ZipOutputStream
219+
- uid: ICSharpCode.SharpZipLib.Zip.ZipStrings
220+
name: ZipStrings
207221
- uid: ICSharpCode.SharpZipLib.Zip.ZipTestResultHandler
208222
name: ZipTestResultHandler
209223
- uid: ICSharpCode.SharpZipLib.Zip.Compression

0 commit comments

Comments
 (0)