├── docs ├── help │ ├── serve.bat │ ├── articles │ │ ├── toc.yml │ │ └── intro.md │ ├── api │ │ ├── .gitignore │ │ └── index.md │ ├── toc.yml │ ├── .gitignore │ ├── index.md │ ├── BuildingHelpInfo.txt │ ├── template │ │ ├── styles │ │ │ └── main.css │ │ └── partials │ │ │ └── navbar.tmpl.partial │ └── docfx.json ├── future │ ├── FILEFMTS.LST │ ├── FILE_ID.DIZ │ ├── FILEFMTS_HYP.md │ ├── FILEFMTS_GZIP.md │ ├── FILEFMTS_LZH.md │ ├── FILEFMTS_DWC.md │ ├── FILEFMTS_LBR.md │ ├── FILEFMTS_ZOO.md │ └── FILEFMTS_HA.md ├── opencover │ ├── pic_branch0.png │ ├── pic_branch10.png │ ├── pic_branch100.png │ ├── pic_branch20.png │ ├── pic_branch30.png │ ├── pic_branch40.png │ ├── pic_branch50.png │ ├── pic_branch60.png │ ├── pic_branch70.png │ ├── pic_branch80.png │ ├── pic_branch90.png │ ├── pic_collapsed.png │ ├── pic_expanded.png │ ├── pic_pin_pinned.png │ ├── pic_pin_unpinned.png │ ├── pic_sortactive_asc.png │ ├── pic_sortinactive.png │ ├── pic_sortactive_desc.png │ ├── ICSharpCode.SharpZipLib_ProgressHandler.htm │ ├── ICSharpCode.SharpZipLib_FileFailureHandler.htm │ ├── ICSharpCode.SharpZipLib_ProcessFileHandler.htm │ ├── ICSharpCode.SharpZipLib_CompletedFileHandler.htm │ ├── ICSharpCode.SharpZipLib_ZipTestResultHandler.htm │ ├── ICSharpCode.SharpZipLib_ProgressMessageHandler.htm │ └── ICSharpCode.SharpZipLib_DirectoryFailureHandler.htm └── specification │ ├── bzip2-manual-1.0.5.html │ └── README.md ├── src └── ICSharpCode.SharpZipLib │ ├── Zip │ ├── ZipHelperStream.cs │ ├── Compression │ │ ├── PooledInflater.cs │ │ └── DeflaterPending.cs │ ├── ZipEncryptionMethod.cs │ ├── ZipEntryExtensions.cs │ └── ZipException.cs │ ├── Tar │ ├── TarStringExtension.cs │ ├── TarException.cs │ └── InvalidHeaderException.cs │ ├── Core │ ├── EmptyRefs.cs │ ├── IScanFilter.cs │ ├── StringBuilderPool.cs │ ├── INameTransform.cs │ ├── InflaterPool.cs │ ├── ExactMemoryPool.cs │ ├── InvalidNameException.cs │ ├── Exceptions │ │ ├── StreamDecodingException.cs │ │ ├── StreamUnsupportedException.cs │ │ ├── UnexpectedEndOfStreamException.cs │ │ ├── SharpZipBaseException.cs │ │ └── ValueOutOfRangeException.cs │ └── PathUtils.cs │ ├── AssemblyInfo.cs │ ├── SharpZipLibOptions.cs │ ├── Checksum │ └── IChecksum.cs │ ├── Lzw │ ├── LzwConstants.cs │ └── LzwException.cs │ ├── GZip │ ├── GZipException.cs │ └── GZipConstants.cs │ ├── BZip2 │ ├── BZip2Exception.cs │ └── BZip2.cs │ └── ICSharpCode.SharpZipLib.csproj ├── .codacy.yaml ├── tools ├── old │ ├── uninstallGAC.bat │ ├── run-reportgenerator.cmd │ ├── installGAC.bat │ ├── run-opencover.cmd │ ├── ICSharpCode.SharpZipLib.version │ ├── sharpziplib.pc │ ├── run-nunit3-tests-debug.cmd │ ├── run-nunit3-tests-release.cmd │ ├── install-fxmicroframework-43-44.ps1 │ ├── run-appveyor-build.ps1 │ └── ICSharpCode.SharpZipLib.nuspec ├── appveyor-docfx-init.ps1 ├── release-notes │ ├── release-notes.json │ ├── README.md │ └── release-notes-md.ejs ├── test-scripts.ps1 ├── appveyor-docfx-build.ps1 ├── appveyor-test.ps1 └── appveyor-install.ps1 ├── .globalconfig ├── test ├── .globalconfig └── ICSharpCode.SharpZipLib.Tests │ ├── app.config │ ├── TestSupport │ ├── ThreadEx.cs │ └── StringTesting.cs │ ├── ICSharpCode.SharpZipLib.Tests.csproj │ ├── Core │ └── StringBuilderPoolTests.cs │ ├── Lzw │ └── LzwTests.cs │ └── Zip │ └── ZipCorruptionHandling.cs ├── benchmark ├── .globalconfig └── ICSharpCode.SharpZipLib.Benchmark │ ├── ICSharpCode.SharpZipLib.Benchmark.csproj │ ├── Program.cs │ ├── Checksum │ ├── Crc32.cs │ ├── Adler32.cs │ └── BZip2Crc.cs │ ├── BZip2 │ └── BZip2InputStream.cs │ ├── Zip │ ├── ZipInputStream.cs │ ├── ZipOutputStream.cs │ └── ZipFile.cs │ └── Tar │ ├── TarOutputStream.cs │ └── TarInputStream.cs ├── assets ├── ICSharpCode.SharpZipLib.snk └── sharpziplib-nuget-256x256.png ├── samples └── ICSharpCode.SharpZipLib.Samples │ ├── cs │ ├── Cmd_ZipInfo │ │ ├── readme.txt │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── app.config │ ├── unzipfile │ │ ├── readme.txt │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── UnZipFile.cs │ │ └── App.config │ ├── viewzipfile │ │ ├── readme.txt │ │ ├── App.config │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── ViewZipFile.cs │ ├── Cmd_GZip │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── readme.txt │ │ └── app.config │ ├── CreateZipFile │ │ ├── app.config │ │ ├── readme.txt │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── CreateZipFile.cs │ ├── Cmd_Checksum │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── readme.txt │ │ └── app.config │ ├── Cmd_BZip2 │ │ ├── readme.txt │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── app.config │ ├── sz │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── app.config │ ├── zf │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── app.config │ ├── FastZip │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── app.config │ ├── Cmd_Tar │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── app.config │ └── SampleAssemblyInfo.cs │ └── vb │ ├── CreateZipFile │ ├── MainForm.resources │ ├── CreateZipFile.MainForm.resources │ ├── My Project │ │ └── AssemblyInfo.vb │ └── app.config │ ├── WpfCreateZipFile │ ├── Application.xaml.vb │ ├── My Project │ │ ├── Settings.settings │ │ └── AssemblyInfo.vb │ ├── Application.xaml │ ├── WpfCreateZipFileWindow.xaml │ ├── WpfCreateZipFileWindow.xaml.vb │ └── App.config │ ├── minibzip2 │ └── My Project │ │ ├── Application.Designer.vb │ │ ├── Application.myapp │ │ └── AssemblyInfo.vb │ ├── viewzipfile │ ├── My Project │ │ └── AssemblyInfo.vb │ └── app.config │ ├── zipfiletest │ └── My Project │ │ └── AssemblyInfo.vb │ └── SampleAssemblyInfo.vb ├── SECURITY.md ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.yml │ └── bug.yml ├── PULL_REQUEST_TEMPLATE.md ├── CONTRIBUTING.md └── workflows │ ├── issue.yml │ ├── release.yml │ └── codeql-analysis.yml ├── .editorconfig ├── CONTRIBUTING.md ├── appveyor.yml ├── LICENSE.txt ├── .travis.yml ├── ICSharpCode.SharpZipLib.sln ├── .gitattributes └── appveyor.yml.old /docs/help/serve.bat: -------------------------------------------------------------------------------- 1 | docfx docfx.json --serve -------------------------------------------------------------------------------- /src/ICSharpCode.SharpZipLib/Zip/ZipHelperStream.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.codacy.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | exclude_paths: 3 | - 'docs/**/*' 4 | -------------------------------------------------------------------------------- /tools/old/uninstallGAC.bat: -------------------------------------------------------------------------------- 1 | gacutil /u ICSharpCode.SharpZipLib 2 | -------------------------------------------------------------------------------- /docs/help/articles/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Introduction 2 | href: intro.md 3 | -------------------------------------------------------------------------------- /docs/help/api/.gitignore: -------------------------------------------------------------------------------- 1 | ############### 2 | # temp file # 3 | ############### 4 | *.yml 5 | -------------------------------------------------------------------------------- /.globalconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | global_level = 1 3 | dotnet_diagnostic.CA2007.severity = warning 4 | -------------------------------------------------------------------------------- /docs/future/FILEFMTS.LST: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/future/FILEFMTS.LST -------------------------------------------------------------------------------- /test/.globalconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | global_level = 2 3 | dotnet_diagnostic.CA2007.severity = none 4 | -------------------------------------------------------------------------------- /benchmark/.globalconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | global_level = 2 3 | dotnet_diagnostic.CA2007.severity = none 4 | -------------------------------------------------------------------------------- /docs/opencover/pic_branch0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_branch0.png -------------------------------------------------------------------------------- /docs/opencover/pic_branch10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_branch10.png -------------------------------------------------------------------------------- /docs/opencover/pic_branch100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_branch100.png -------------------------------------------------------------------------------- /docs/opencover/pic_branch20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_branch20.png -------------------------------------------------------------------------------- /docs/opencover/pic_branch30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_branch30.png -------------------------------------------------------------------------------- /docs/opencover/pic_branch40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_branch40.png -------------------------------------------------------------------------------- /docs/opencover/pic_branch50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_branch50.png -------------------------------------------------------------------------------- /docs/opencover/pic_branch60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_branch60.png -------------------------------------------------------------------------------- /docs/opencover/pic_branch70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_branch70.png -------------------------------------------------------------------------------- /docs/opencover/pic_branch80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_branch80.png -------------------------------------------------------------------------------- /docs/opencover/pic_branch90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_branch90.png -------------------------------------------------------------------------------- /docs/opencover/pic_collapsed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_collapsed.png -------------------------------------------------------------------------------- /docs/opencover/pic_expanded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_expanded.png -------------------------------------------------------------------------------- /assets/ICSharpCode.SharpZipLib.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/assets/ICSharpCode.SharpZipLib.snk -------------------------------------------------------------------------------- /docs/opencover/pic_pin_pinned.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_pin_pinned.png -------------------------------------------------------------------------------- /assets/sharpziplib-nuget-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/assets/sharpziplib-nuget-256x256.png -------------------------------------------------------------------------------- /docs/opencover/pic_pin_unpinned.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_pin_unpinned.png -------------------------------------------------------------------------------- /docs/opencover/pic_sortactive_asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_sortactive_asc.png -------------------------------------------------------------------------------- /docs/opencover/pic_sortinactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_sortinactive.png -------------------------------------------------------------------------------- /docs/help/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Articles 2 | href: articles/ 3 | - name: Api Documentation 4 | href: api/ 5 | homepage: api/index.md 6 | -------------------------------------------------------------------------------- /docs/opencover/pic_sortactive_desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/opencover/pic_sortactive_desc.png -------------------------------------------------------------------------------- /docs/help/api/index.md: -------------------------------------------------------------------------------- 1 | # API Documentation 2 | 3 | Please select class / method / property from the tree on the left side to learn more. 4 | -------------------------------------------------------------------------------- /docs/specification/bzip2-manual-1.0.5.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/docs/specification/bzip2-manual-1.0.5.html -------------------------------------------------------------------------------- /docs/help/articles/intro.md: -------------------------------------------------------------------------------- 1 | # Articles 2 | 3 | FAQ and walk-through-sample explanations are provided in the [Wiki](https://github.com/icsharpcode/SharpZipLib/wiki) 4 | -------------------------------------------------------------------------------- /docs/help/.gitignore: -------------------------------------------------------------------------------- 1 | ############### 2 | # folder # 3 | ############### 4 | /**/DROP/ 5 | /**/TEMP/ 6 | /**/packages/ 7 | /**/bin/ 8 | /**/obj/ 9 | _site 10 | -------------------------------------------------------------------------------- /tools/old/run-reportgenerator.cmd: -------------------------------------------------------------------------------- 1 | packages\ReportGenerator.2.4.5.0\tools\ReportGenerator.exe -reports:Documentation\opencover-results-release.xml -targetdir:Documentation\opencover 2 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/Cmd_ZipInfo/readme.txt: -------------------------------------------------------------------------------- 1 | ziplist 2 | ------- 3 | 4 | Usage: 5 | 6 | 7 | ziplist [filename] 8 | 9 | will view the headers of the zipfile [filename] -------------------------------------------------------------------------------- /tools/appveyor-docfx-init.ps1: -------------------------------------------------------------------------------- 1 | if(-Not $env:APPVEYOR_PULL_REQUEST_TITLE -and $env:CONFIGURATION -eq "Release") 2 | { 3 | git checkout $env:APPVEYOR_REPO_BRANCH -q 4 | choco install docfx -y 5 | } -------------------------------------------------------------------------------- /tools/old/installGAC.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cd bin 3 | echo installing ICSharpCode.SharpZipLib.dll into the GAC 4 | gacutil /i ICSharpCode.SharpZipLib.dll 5 | cd .. 6 | 7 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/unzipfile/readme.txt: -------------------------------------------------------------------------------- 1 | viewzipfile 2 | ----------- 3 | 4 | Usage: 5 | 6 | 7 | unzipfile [filename] 8 | 9 | will unzip the contents of the zipfile [filename] -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/viewzipfile/readme.txt: -------------------------------------------------------------------------------- 1 | viewzipfile 2 | ----------- 3 | 4 | Usage: 5 | 6 | 7 | viewzipfile [filename] 8 | 9 | will view the contents of the zipfile [filename] -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/vb/CreateZipFile/MainForm.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/samples/ICSharpCode.SharpZipLib.Samples/vb/CreateZipFile/MainForm.resources -------------------------------------------------------------------------------- /tools/release-notes/release-notes.json: -------------------------------------------------------------------------------- 1 | { 2 | "title" : "^([a-z]+)(?:\\(([\\w\\$\\.]*)\\))?\\: (.*?)(?: \\(#(\\d+)\\))?$", 3 | "meaning": ["type", "scope", "title", "issue"], 4 | "script": "release-notes.js" 5 | } 6 | -------------------------------------------------------------------------------- /tools/old/run-opencover.cmd: -------------------------------------------------------------------------------- 1 | packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -register:user -filter:+[ICSharpCode.SharpZipLib]* -target:Build\run-nunit3-tests-release.cmd -output:Documentation\opencover-results-release.xml 2 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/vb/CreateZipFile/CreateZipFile.MainForm.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icsharpcode/SharpZipLib/HEAD/samples/ICSharpCode.SharpZipLib.Samples/vb/CreateZipFile/CreateZipFile.MainForm.resources -------------------------------------------------------------------------------- /tools/old/ICSharpCode.SharpZipLib.version: -------------------------------------------------------------------------------- 1 | nuget_version=1.0.0 2 | full_version=1.0.0.0 3 | release_notes_link=https://github.com/icsharpcode/SharpZipLib/wiki/Release-1.0/ 4 | copyright=Copyright © 2000-2016 AlphaSierraPapa for the SharpZipLib Team 5 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/Cmd_GZip/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | [assembly: AssemblyTitle("Cmd_GZip")] 4 | [assembly: AssemblyDescription("gzip based file compression")] 5 | [assembly: AssemblyCulture("")] 6 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/CreateZipFile/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/vb/WpfCreateZipFile/Application.xaml.vb: -------------------------------------------------------------------------------- 1 | Class Application 2 | 3 | ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException 4 | ' can be handled in this file. 5 | 6 | End Class 7 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/Cmd_Checksum/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | [assembly: AssemblyTitle("Cmd_Checksum")] 4 | [assembly: AssemblyDescription("file checksum generator")] 5 | [assembly: AssemblyCulture("")] 6 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/viewzipfile/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tools/old/sharpziplib.pc: -------------------------------------------------------------------------------- 1 | prefix=/usr 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | 5 | Name: sharpziplib 6 | Description: C# Zip, GZip, Tar and BZip2 library for .NET 7 | Version: 0.86 8 | Libs: -r:${libdir}/mono/sharpziplib/ICSharpCode.SharpZipLib.dll -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/Cmd_ZipInfo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | [assembly: AssemblyTitle("Cmd_ZipInfo")] 4 | [assembly: AssemblyDescription("list detailed information about a ZIP archive")] 5 | [assembly: AssemblyCulture("")] 6 | -------------------------------------------------------------------------------- /tools/old/run-nunit3-tests-debug.cmd: -------------------------------------------------------------------------------- 1 | packages\NUnit.ConsoleRunner.3.2.1\tools\nunit3-console.exe --framework=net-4.5 --domain=Single --testlist=ICSharpCode.SharpZipLib.Tests\PassingTests.txt --result=Documentation\nunit3-test-results-debug.xml bin\Debug\ICSharpCode.SharpZipLib.Tests.dll 2 | -------------------------------------------------------------------------------- /tools/old/run-nunit3-tests-release.cmd: -------------------------------------------------------------------------------- 1 | packages\NUnit.ConsoleRunner.3.2.1\tools\nunit3-console.exe --framework=net-4.5 --domain=Single --testlist=ICSharpCode.SharpZipLib.Tests\PassingTests.txt --result=Documentation\nunit3-test-results-release.xml bin\Release\ICSharpCode.SharpZipLib.Tests.dll 2 | -------------------------------------------------------------------------------- /tools/release-notes/README.md: -------------------------------------------------------------------------------- 1 | ## Requirements 2 | ``` 3 | npm install -g git-release-notes 4 | ``` 5 | 6 | ## Usage 7 | ``` 8 | git release-notes -f release-notes.json PREVIOUS..CURRENT release-notes-md.ejs 9 | ``` 10 | Where PREVIOUS is the previous release tag, and CURRENT is the current release tag 11 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | | Version | Supported | 6 | | ------- | ------------------ | 7 | | 1.3.x | :white_check_mark: | 8 | | < 1.3 | :x: | 9 | 10 | ## Reporting a Vulnerability 11 | 12 | Send an e-mail to sharpziplib@containrrr.dev 13 | -------------------------------------------------------------------------------- /docs/help/index.md: -------------------------------------------------------------------------------- 1 | # Help Homepage. 2 | 3 | Looking for the [API Documentation](api/index.md)? 4 | 5 | Looking for the [source code](https://github.com/icsharpcode/SharpZipLib)? 6 | 7 | Want to report a bug, suggest a new feature, ask a deep technical question? [Issues](https://github.com/icsharpcode/SharpZipLib/issues) 8 | 9 | -------------------------------------------------------------------------------- /docs/future/FILE_ID.DIZ: -------------------------------------------------------------------------------- 1 | File formats Release #03 12/02 2 | 3 | A documentation of over 100 file 4 | formats covering : 5 | 6 | Modules : (MOD,S3M,669,XM,etc.) 7 | Images : (GIF,LBM,IFF,PCX,etc.) 8 | Binaries: (COM,EXE,Windows,etc.) 9 | Archives: (ARJ,LHA,ZIP,etc.) 10 | Sound : (VOC,WAV,ZYX,.AU,etc.) 11 | DataBase: (DBF) -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/vb/WpfCreateZipFile/My Project/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/Cmd_BZip2/readme.txt: -------------------------------------------------------------------------------- 1 | minibzip2 2 | --------- 3 | 4 | Usage: 5 | 6 | 7 | minibzip2 [filename] 8 | 9 | Will create (or overwrite) a file [filename].bz2 with the bzipped 10 | contents of [filename] 11 | 12 | minibzip2 -d [filename].bz2 13 | 14 | Will create (or overwrite) a file [filename] with the bunzipped 15 | contents of [filename] -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/CreateZipFile/readme.txt: -------------------------------------------------------------------------------- 1 | createzipfile 2 | ------------- 3 | 4 | Usage: 5 | 6 | createzipfile [directoryname] [zipfilename] 7 | 8 | will create zipfilename and store all files in the directory [directoryname] 9 | in it. 10 | 11 | (btw. [directoryname] is a directoryname like C:\testdir not *.* or other 12 | wildcards) 13 | 14 | -------------------------------------------------------------------------------- /src/ICSharpCode.SharpZipLib/Tar/TarStringExtension.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using ICSharpCode.SharpZipLib.Core; 3 | 4 | namespace ICSharpCode.SharpZipLib.Tar 5 | { 6 | internal static class TarStringExtension 7 | { 8 | public static string ToTarArchivePath(this string s) 9 | { 10 | return PathUtils.DropPathRoot(s).Replace(Path.DirectorySeparatorChar, '/'); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/Cmd_GZip/readme.txt: -------------------------------------------------------------------------------- 1 | minigzip 2 | -------- 3 | 4 | Usage: 5 | 6 | 7 | minigzip [filename] 8 | 9 | Will create (or overwrite) a file [filename].gz with the gzipped 10 | contents of [filename] 11 | 12 | minigzip -d [filename].gz 13 | 14 | Will create (or overwrite) a file [filename] with the gunzipped 15 | contents of [filename] 16 | 17 | 18 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/Cmd_Checksum/readme.txt: -------------------------------------------------------------------------------- 1 | minigzip 2 | -------- 3 | 4 | Usage: 5 | 6 | 7 | minigzip [filename] 8 | 9 | Will create (or overwrite) a file [filename].gz with the gzipped 10 | contents of [filename] 11 | 12 | minigzip -d [filename].gz 13 | 14 | Will create (or overwrite) a file [filename] with the gunzipped 15 | contents of [filename] 16 | 17 | 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Ask a question 4 | url: https://github.com/icsharpcode/SharpZipLib/discussions/new?category=q-a 5 | about: Post any questions in QA discussions instead of creating an issue 6 | - name: Discuss 7 | url: https://github.com/icsharpcode/SharpZipLib/discussions/new 8 | about: Discuss with other community members 9 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/sz/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | // General Information about an assembly is controlled through the following 4 | // set of attributes. Change these attribute values to modify the information 5 | // associated with an assembly. 6 | [assembly: AssemblyTitle("SZ")] 7 | [assembly: AssemblyDescription("A SharpZipLib sample program")] 8 | [assembly: AssemblyCulture("")] 9 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/zf/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | // General Information about an assembly is controlled through the following 4 | // set of attributes. Change these attribute values to modify the information 5 | // associated with an assembly. 6 | [assembly: AssemblyTitle("ZF")] 7 | [assembly: AssemblyDescription("A SharpZipLib sample program")] 8 | [assembly: AssemblyCulture("")] 9 | -------------------------------------------------------------------------------- /src/ICSharpCode.SharpZipLib/Core/EmptyRefs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ICSharpCode.SharpZipLib.Core 4 | { 5 | internal static class Empty 6 | { 7 | #if NET45 8 | internal static class EmptyArray 9 | { 10 | public static readonly T[] Value = new T[0]; 11 | } 12 | public static T[] Array() => EmptyArray.Value; 13 | #else 14 | public static T[] Array() => System.Array.Empty(); 15 | #endif 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/Cmd_BZip2/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | // General Information about an assembly is controlled through the following 4 | // set of attributes. Change these attribute values to modify the information 5 | // associated with an assembly. 6 | [assembly: AssemblyTitle("Cmd_BZip2")] 7 | [assembly: AssemblyDescription("bzip2 based file compression")] 8 | [assembly: AssemblyCulture("")] 9 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/FastZip/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | // General Information about an assembly is controlled through the following 4 | // set of attributes. Change these attribute values to modify the information 5 | // associated with an assembly. 6 | [assembly: AssemblyTitle("FastZip sample")] 7 | [assembly: AssemblyDescription("A SharpZipLib sample program")] 8 | [assembly: AssemblyCulture("")] 9 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/unzipfile/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | // General Information about an assembly is controlled through the following 4 | // set of attributes. Change these attribute values to modify the information 5 | // associated with an assembly. 6 | [assembly: AssemblyTitle("UnZipFile")] 7 | [assembly: AssemblyDescription("A SharpZipLib sample program")] 8 | [assembly: AssemblyCulture("")] 9 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/Cmd_Tar/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | // Information about this assembly is defined by the following 4 | // attributes. 5 | // 6 | // change them to the information which is associated with the assembly 7 | // you compile. 8 | 9 | [assembly: AssemblyTitle("Tar Sharp Sample")] 10 | [assembly: AssemblyDescription("A simple tar application")] 11 | [assembly: AssemblyCulture("")] 12 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/CreateZipFile/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | // General Information about an assembly is controlled through the following 4 | // set of attributes. Change these attribute values to modify the information 5 | // associated with an assembly. 6 | [assembly: AssemblyTitle("CreateZipFile")] 7 | [assembly: AssemblyDescription("A SharpZipLib sample program")] 8 | [assembly: AssemblyCulture("")] 9 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/viewzipfile/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | // General Information about an assembly is controlled through the following 4 | // set of attributes. Change these attribute values to modify the information 5 | // associated with an assembly. 6 | [assembly: AssemblyTitle("ViewZipFile")] 7 | [assembly: AssemblyDescription("A SharpZipLib sample program")] 8 | [assembly: AssemblyCulture("")] 9 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 4 | _I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License._ 5 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/vb/WpfCreateZipFile/Application.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/ICSharpCode.SharpZipLib/Zip/Compression/PooledInflater.cs: -------------------------------------------------------------------------------- 1 | using ICSharpCode.SharpZipLib.Core; 2 | 3 | namespace ICSharpCode.SharpZipLib.Zip.Compression 4 | { 5 | /// 6 | /// A marker type for pooled version of an inflator that we can return back to . 7 | /// 8 | internal sealed class PooledInflater : Inflater 9 | { 10 | public PooledInflater(bool noHeader) : base(noHeader) 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/ICSharpCode.SharpZipLib/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("ICSharpCode.SharpZipLib.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b9a14ea8fc9d7599e0e82a1292a23103f0210e2f928a0f466963af23fffadba59dcc8c9e26ecd114d7c0b4179e4bc93b1656b7ee2d4a67dd7c1992653e0d9cc534f7914b6f583b022e0a7aa8a430f407932f9a6806f0fc64d61e78d5ae01aa8f8233196719d44da2c50a2d1cfa3f7abb7487b3567a4f0456aa6667154c6749b1")] 4 | -------------------------------------------------------------------------------- /test/ICSharpCode.SharpZipLib.Tests/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/ICSharpCode.SharpZipLib/SharpZipLibOptions.cs: -------------------------------------------------------------------------------- 1 | using ICSharpCode.SharpZipLib.Zip.Compression; 2 | 3 | namespace ICSharpCode.SharpZipLib 4 | { 5 | /// 6 | /// Global options to alter behavior. 7 | /// 8 | public static class SharpZipLibOptions 9 | { 10 | /// 11 | /// The max pool size allowed for reusing instances, defaults to 0 (disabled). 12 | /// 13 | public static int InflaterPoolSize { get; set; } = 0; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/ICSharpCode.SharpZipLib/Core/IScanFilter.cs: -------------------------------------------------------------------------------- 1 | namespace ICSharpCode.SharpZipLib.Core 2 | { 3 | /// 4 | /// Scanning filters support filtering of names. 5 | /// 6 | public interface IScanFilter 7 | { 8 | /// 9 | /// Test a name to see if it 'matches' the filter. 10 | /// 11 | /// The name to test. 12 | /// Returns true if the name matches the filter, false if it does not match. 13 | bool IsMatch(string name); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /benchmark/ICSharpCode.SharpZipLib.Benchmark/ICSharpCode.SharpZipLib.Benchmark.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net462;net6.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/ICSharpCode.SharpZipLib/Zip/Compression/DeflaterPending.cs: -------------------------------------------------------------------------------- 1 | namespace ICSharpCode.SharpZipLib.Zip.Compression 2 | { 3 | /// 4 | /// This class stores the pending output of the Deflater. 5 | /// 6 | /// author of the original java version : Jochen Hoenicke 7 | /// 8 | public class DeflaterPending : PendingBuffer 9 | { 10 | /// 11 | /// Construct instance with default buffer size 12 | /// 13 | public DeflaterPending() : base(DeflaterConstants.PENDING_BUF_SIZE) 14 | { 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/vb/minibzip2/My Project/Application.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.42000 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | -------------------------------------------------------------------------------- /docs/help/BuildingHelpInfo.txt: -------------------------------------------------------------------------------- 1 | # Basics 2 | 3 | You need DocFx: 4 | 5 | https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html#2-use-docfx-as-a-command-line-tool 6 | 7 | You have to run it using the "Developer Command Prompt for VS 2017" 8 | 9 | 10 | # Building 11 | 12 | In this folder, run "docfx metadata" to build the API documentation (/api folder) 13 | 14 | In this folder, run "serve.bat" to build & serve the documenation for local testing 15 | 16 | 17 | # Publishing 18 | 19 | The _site folder is to be copied to gh-pages branch for publishing -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/vb/minibzip2/My Project/Application.myapp: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | MainForm 5 | false 6 | 0 7 | true 8 | 0 9 | true 10 | -------------------------------------------------------------------------------- /test/ICSharpCode.SharpZipLib.Tests/TestSupport/ThreadEx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Reflection; 4 | 5 | public class ThreadEx 6 | { 7 | public static void Abort(Thread thread) 8 | { 9 | MethodInfo abort = null; 10 | foreach(MethodInfo m in thread.GetType().GetMethods(BindingFlags.NonPublic | BindingFlags.Instance)) 11 | { 12 | if (m.Name.Equals("AbortInternal") && m.GetParameters().Length == 0) abort = m; 13 | } 14 | if (abort == null) 15 | { 16 | throw new Exception("Failed to get Thread.Abort method"); 17 | } 18 | abort.Invoke(thread, new object[0]); 19 | } 20 | } -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/vb/minibzip2/My Project/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System.Reflection 2 | Imports System.Runtime.InteropServices 3 | 4 | ' General Information about an assembly is controlled through the following 5 | ' set of attributes. Change these attribute values to modify the information 6 | ' associated with an assembly. 7 | 8 | ' Review the values of the assembly attributes 9 | 10 | 11 | 12 | 13 | 'The following GUID is for the ID of the typelib if this project is exposed to COM 14 | 15 | -------------------------------------------------------------------------------- /src/ICSharpCode.SharpZipLib/Core/StringBuilderPool.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Concurrent; 2 | using System.Text; 3 | 4 | namespace ICSharpCode.SharpZipLib.Core 5 | { 6 | internal class StringBuilderPool 7 | { 8 | public static StringBuilderPool Instance { get; } = new StringBuilderPool(); 9 | private readonly ConcurrentQueue pool = new ConcurrentQueue(); 10 | 11 | public StringBuilder Rent() 12 | { 13 | return pool.TryDequeue(out var builder) ? builder : new StringBuilder(); 14 | } 15 | 16 | public void Return(StringBuilder builder) 17 | { 18 | builder.Clear(); 19 | pool.Enqueue(builder); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/ICSharpCode.SharpZipLib/Zip/ZipEncryptionMethod.cs: -------------------------------------------------------------------------------- 1 | namespace ICSharpCode.SharpZipLib.Zip 2 | { 3 | /// 4 | /// The method of encrypting entries when creating zip archives. 5 | /// 6 | public enum ZipEncryptionMethod 7 | { 8 | /// 9 | /// No encryption will be used. 10 | /// 11 | None, 12 | 13 | /// 14 | /// Encrypt entries with ZipCrypto. 15 | /// 16 | ZipCrypto, 17 | 18 | /// 19 | /// Encrypt entries with AES 128. 20 | /// 21 | AES128, 22 | 23 | /// 24 | /// Encrypt entries with AES 256. 25 | /// 26 | AES256 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/vb/viewzipfile/My Project/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System.Reflection 2 | Imports System.Runtime.InteropServices 3 | 4 | ' General Information about an assembly is controlled through the following 5 | ' set of attributes. Change these attribute values to modify the information 6 | ' associated with an assembly. 7 | 8 | ' Review the values of the assembly attributes 9 | 10 | 11 | 12 | 13 | 'The following GUID is for the ID of the typelib if this project is exposed to COM 14 | 15 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/vb/zipfiletest/My Project/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System.Reflection 2 | Imports System.Runtime.InteropServices 3 | 4 | ' General Information about an assembly is controlled through the following 5 | ' set of attributes. Change these attribute values to modify the information 6 | ' associated with an assembly. 7 | 8 | ' Review the values of the assembly attributes 9 | 10 | 11 | 12 | 13 | 'The following GUID is for the ID of the typelib if this project is exposed to COM 14 | 15 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/vb/CreateZipFile/My Project/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System.Reflection 2 | Imports System.Runtime.InteropServices 3 | 4 | ' General Information about an assembly is controlled through the following 5 | ' set of attributes. Change these attribute values to modify the information 6 | ' associated with an assembly. 7 | 8 | ' Review the values of the assembly attributes 9 | 10 | 11 | 12 | 13 | 'The following GUID is for the ID of the typelib if this project is exposed to COM 14 | 15 | -------------------------------------------------------------------------------- /benchmark/ICSharpCode.SharpZipLib.Benchmark/Program.cs: -------------------------------------------------------------------------------- 1 | using BenchmarkDotNet.Configs; 2 | using BenchmarkDotNet.Jobs; 3 | using BenchmarkDotNet.Running; 4 | using BenchmarkDotNet.Toolchains.CsProj; 5 | 6 | namespace ICSharpCode.SharpZipLib.Benchmark 7 | { 8 | public class MultipleRuntimes : ManualConfig 9 | { 10 | public MultipleRuntimes() 11 | { 12 | AddJob(Job.Default.WithToolchain(CsProjClassicNetToolchain.Net462).AsBaseline()); // NET 4.6.2 13 | AddJob(Job.Default.WithToolchain(CsProjCoreToolchain.NetCoreApp60)); // .NET 6.0 14 | } 15 | } 16 | 17 | class Program 18 | { 19 | static void Main(string[] args) 20 | { 21 | BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tools/old/install-fxmicroframework-43-44.ps1: -------------------------------------------------------------------------------- 1 | Write-Host "Installing .NET MicroFramework 4.3 ..." 2 | $msiPath = "$($env:USERPROFILE)\MicroFrameworkSDK43.MSI" 3 | (New-Object Net.WebClient).DownloadFile('http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=netmf&DownloadId=1423116&FileTime=130667921437670000&Build=21031', $msiPath) 4 | cmd /c start /wait msiexec /i $msiPath /quiet 5 | Write-Host "Installed" -ForegroundColor green 6 | 7 | Write-Host "Installing .NET MicroFramework 4.4 ..." 8 | $msiPath = "$($env:USERPROFILE)\MicroFrameworkSDK44.MSI" 9 | (New-Object Net.WebClient).DownloadFile('https://github.com/NETMF/netmf-interpreter/releases/download/v4.4-RTW-20-Oct-2015/MicroFrameworkSDK.MSI', $msiPath) 10 | cmd /c start /wait msiexec /i $msiPath /quiet 11 | Write-Host "Installed" -ForegroundColor green 12 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Default settings: 7 | # A newline ending every file 8 | # Use 4 spaces as indentation 9 | [*] 10 | insert_final_newline = true 11 | indent_style = tab 12 | indent_size = 4 13 | 14 | # C++ Files 15 | [*.{cpp,h,in}] 16 | curly_bracket_next_line = true 17 | indent_brace_style = Allman 18 | 19 | # Xml project files 20 | [*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}] 21 | indent_size = 2 22 | 23 | # Xml files 24 | [*.{xml,stylecop,resx,ruleset}] 25 | indent_size = 2 26 | 27 | # Xml config files 28 | [*.{props,targets,config,nuspec}] 29 | indent_size = 2 30 | 31 | # Shell scripts 32 | [*.sh] 33 | end_of_line = lf 34 | [*.{cmd, bat}] 35 | end_of_line = crlf 36 | 37 | [*.yml] 38 | indent_style = space 39 | indent_size = 2 40 | -------------------------------------------------------------------------------- /src/ICSharpCode.SharpZipLib/Core/INameTransform.cs: -------------------------------------------------------------------------------- 1 | namespace ICSharpCode.SharpZipLib.Core 2 | { 3 | /// 4 | /// INameTransform defines how file system names are transformed for use with archives, or vice versa. 5 | /// 6 | public interface INameTransform 7 | { 8 | /// 9 | /// Given a file name determine the transformed value. 10 | /// 11 | /// The name to transform. 12 | /// The transformed file name. 13 | string TransformFile(string name); 14 | 15 | /// 16 | /// Given a directory name determine the transformed value. 17 | /// 18 | /// The name to transform. 19 | /// The transformed directory name 20 | string TransformDirectory(string name); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to SharpZipLib 2 | 3 | Thanks for helping to improve SharpZipLib. 4 | 5 | In order for your changes to be accepted you can either sign the [Joint Copyright Assignment](http://www.icsharpcode.net/TechNotes/JointCopyrightAssignment.pdf) or add the following statement to your pull request: 6 | 7 | _I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License._ 8 | 9 | Unless we have a Joint Copyright Agreement on file or this statement is in your pull request, we cannot accept it. 10 | 11 | More information is available on [joining the team](https://github.com/icsharpcode/SharpDevelop/wiki/Joining-the-Team). 12 | -------------------------------------------------------------------------------- /tools/test-scripts.ps1: -------------------------------------------------------------------------------- 1 | $env:APPVEYOR_BUILD_NUMBER = 123; 2 | 3 | function Test-Install { 4 | param( [string]$PR, [string]$Branch ) 5 | Write-Host -n "-- Testing with PR " 6 | if($PR -eq "") { Write-Host -n -f red "No" } else { Write-Host -n -f cyan "#$PR" } 7 | Write-Host -n " and branch " 8 | if($Branch -eq "master") { Write-Host -f green "master" } else { Write-Host -f cyan "$Branch" } 9 | $env:APPVEYOR_PULL_REQUEST_NUMBER = $PR; 10 | $env:APPVEYOR_REPO_BRANCH = $Branch; 11 | .\appveyor-install.ps1 12 | Write-Host "---------------------------------------------------------------------"; 13 | Write-Host; 14 | } 15 | 16 | function appveyor { 17 | # Dummy function for compability with AV 18 | } 19 | 20 | Write-Host; 21 | Test-Install "" "master" 22 | Test-Install 42 "master" 23 | Test-Install "" "misc-feature" 24 | Test-Install 36 "other-branch" -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to SharpZipLib 2 | 3 | Thanks for helping to improve SharpZipLib. 4 | 5 | In order for your changes to be accepted you can either sign the [Joint Copyright Assignment](http://www.icsharpcode.net/TechNotes/JointCopyrightAssignment.pdf) or add the following statement to your pull request: 6 | 7 | _I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License._ 8 | 9 | Unless we have a Joint Copyright Agreement on file or this statement is in your pull request, we cannot accept it. 10 | 11 | More information is available on [joining the team](https://github.com/icsharpcode/SharpDevelop/wiki/Joining-the-Team). 12 | -------------------------------------------------------------------------------- /docs/help/template/styles/main.css: -------------------------------------------------------------------------------- 1 | button, a { 2 | color: #516d86; 3 | cursor: pointer; 4 | } 5 | 6 | .affix > ul > li.active > a, .affix > ul > li.active > a:before, 7 | .affix ul > li.active > a, .affix ul > li.active > a:before { 8 | color: #516d86; 9 | } 10 | 11 | .toc .nav > li.active > a { 12 | color: #7391ab; 13 | } 14 | 15 | .navbar-default .navbar-nav>.active>a, .navbar-default .navbar-nav>.active>a:focus, .navbar-default .navbar-nav>.active>a:hover { 16 | color: #181c20; 17 | background-color: #c4cdd4; 18 | } 19 | 20 | svg:hover path { 21 | fill: currentColor; 22 | } 23 | 24 | .navbar-default .navbar-brand:focus, .navbar-default .navbar-brand:hover { 25 | color: #3d4852; 26 | } 27 | 28 | #toc .level1 > li { 29 | font-weight: normal; 30 | font-size: 14px; 31 | } 32 | 33 | #sidetoc .sidetoc.shiftup { 34 | bottom: 50px; 35 | } 36 | -------------------------------------------------------------------------------- /docs/help/template/partials/navbar.tmpl.partial: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: '{build}' 2 | image: Visual Studio 2019 3 | configuration: 4 | - Debug 5 | - Release 6 | dotnet_csproj: 7 | patch: true 8 | file: '**\*.csproj' 9 | version: $(VERSION) 10 | package_version: $(VERSION) 11 | assembly_version: $(BIN_VERSION) 12 | file_version: $(BIN_VERSION) 13 | informational_version: $(VERSION) 14 | install: 15 | - ps: tools/appveyor-install.ps1 16 | nuget: 17 | project_feed: true 18 | disable_publish_on_pr: true 19 | before_build: 20 | - ps: nuget restore ICSharpCode.SharpZipLib.sln 21 | - ps: .\tools\appveyor-docfx-init.ps1 22 | build: 23 | project: ICSharpCode.SharpZipLib.sln 24 | publish_nuget: true 25 | publish_nuget_symbols: true 26 | verbosity: normal 27 | after_build: 28 | - ps: .\tools\appveyor-docfx-build.ps1 29 | test_script: 30 | - ps: tools\appveyor-test.ps1 31 | artifacts: 32 | - path: docs\help\_site 33 | type: zip 34 | name: Documentation 35 | -------------------------------------------------------------------------------- /docs/specification/README.md: -------------------------------------------------------------------------------- 1 | SharpZipLib Specifications 2 | ========================== 3 | 4 | | Spec | Title |Version| 5 | |:------:|:----------------------------------------------------|-------| 6 | |[bzip2 Manual](bzip2-manual-1.0.5.html)|Manual for bzip2 and libbzip2|1.0.5| 7 | |[RFC 1950](rfc1950.txt)|ZLIB Compressed Data Format Specification|3.3| 8 | |[RFC 1951](rfc1951.txt)|DEFLATE Compressed Data Format Specification|1.3| 9 | |[RFC 1952](rfc1952.txt)|GZIP file format specification|4.3| 10 | |[gzip format](format.txt)|Provides additional information not in the RFCs|| 11 | |[gzip algorithm](algorithm.txt)|Brief description of the algorithms used by gzip|| 12 | |[tar chapter 8](tar_8.html)|GNU tar manual, "Controlling the Archive Format"|1.28| 13 | |[tar appendix d](tar_14.html)|GNU tar manual, "Tar Internals"|1.28| 14 | |[zip appnote](appnote.txt)|ZIP File Format Specification|6.3.4| 15 | -------------------------------------------------------------------------------- /test/ICSharpCode.SharpZipLib.Tests/TestSupport/StringTesting.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace ICSharpCode.SharpZipLib.Tests.TestSupport 5 | { 6 | public static class StringTesting 7 | { 8 | static StringTesting() 9 | { 10 | TestSamples = new [] 11 | { 12 | ("Chinese", "測試.txt", "big5"), 13 | ("Greek", "Ϗΰ.txt", "windows-1253"), 14 | ("Nordic", "Åæ.txt", "windows-1252"), 15 | ("Arabic", "ڀڅ.txt", "windows-1256"), 16 | ("Russian", "Прйвёт.txt", "windows-1251"), 17 | }; 18 | } 19 | 20 | public static (string language, string filename, string encoding)[] TestSamples { get; } 21 | 22 | public static IEnumerable Languages => TestSamples.Select(s => s.language); 23 | public static IEnumerable Filenames => TestSamples.Select(s => s.filename); 24 | public static IEnumerable Encodings => TestSamples.Select(s => s.encoding); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tools/appveyor-docfx-build.ps1: -------------------------------------------------------------------------------- 1 | if(-Not $env:APPVEYOR_PULL_REQUEST_TITLE -and $env:CONFIGURATION -eq "Release") 2 | { 3 | pushd docs\help 4 | # & docfx metadata 5 | & docfx docfx.json 6 | if ($lastexitcode -ne 0){ 7 | throw [System.Exception] "docfx build failed with exit code $lastexitcode." 8 | } 9 | popd 10 | <# 11 | ## Useful for automatically updating gh pages: 12 | 13 | git config --global credential.helper store 14 | Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n" 15 | git config --global user.email $env:op_build_user_email 16 | git config --global user.name $env:op_build_user 17 | git clone https://github.com/ICSharpCode/SharpZipLib.git -b gh-pages origin_site -q 18 | Copy-Item origin_site/.git _site -recurse 19 | CD _site 20 | git add -A 2>&1 21 | git commit -m "CI Updates" -q 22 | git push origin gh-pages -q 23 | #> 24 | } -------------------------------------------------------------------------------- /tools/appveyor-test.ps1: -------------------------------------------------------------------------------- 1 | $proj = ".\test\ICSharpCode.SharpZipLib.TestBootstrapper\ICSharpCode.SharpZipLib.TestBootstrapper.csproj"; 2 | $resxml = ".\docs\nunit3-test-results-debug.xml"; 3 | 4 | # Nuget 3 Console runner: 5 | #$tester = "nunit3-console .\test\ICSharpCode.SharpZipLib.Tests\bin\$($env:CONFIGURATION)\netcoreapp2.0\ICSharpCode.SharpZipLib.Tests.dll" 6 | 7 | # Bootstrapper: 8 | $tester = "dotnet run -f netcoreapp3.1 -p $proj -c $env:CONFIGURATION"; 9 | iex "$tester --explore=tests.xml"; 10 | 11 | [xml]$xml = Get-Content("tests.xml"); 12 | $assembly = select-xml "/test-suite[@type='Assembly']" $xml | select -f 1 -exp Node; 13 | $testcases = select-xml "//test-case" $xml | % { Add-AppveyorTest -Name $_.Node.fullname -Framework NUnit -Filename $assembly.name }; 14 | 15 | iex "$tester --result=$resxml"; 16 | 17 | $wc = New-Object 'System.Net.WebClient'; 18 | $wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit3/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $resxml)); -------------------------------------------------------------------------------- /.github/workflows/issue.yml: -------------------------------------------------------------------------------- 1 | name: Apply labels from issue 2 | 3 | on: 4 | issues: 5 | types: [opened, edited] 6 | 7 | jobs: 8 | Process_Issue: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Parse Issue Forms Body 12 | id: parse 13 | uses: zentered/issue-forms-body-parser@v1.4.3 14 | - name: Apply labels from tags 15 | uses: actions/github-script@v6 16 | env: 17 | PARSED_DATA: "${{ steps.parse.outputs.data }}" 18 | with: 19 | script: | 20 | const parsed = JSON.parse(process.env["PARSED_DATA"]); 21 | const tags = parsed.tags.text; 22 | console.log('Parsed tags:', tags); 23 | const labels = tags.split(',').map( t => t.trim().toLowerCase() ); 24 | console.log('Applying labels:', labels); 25 | github.rest.issues.addLabels({ 26 | issue_number: context.issue.number, 27 | owner: context.repo.owner, 28 | repo: context.repo.repo, 29 | labels, 30 | }) 31 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright © 2000-2018 SharpZipLib Contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this 4 | software and associated documentation files (the "Software"), to deal in the Software 5 | without restriction, including without limitation the rights to use, copy, modify, merge, 6 | publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons 7 | to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or 10 | substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 13 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 14 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 15 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 16 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 17 | DEALINGS IN THE SOFTWARE. 18 | -------------------------------------------------------------------------------- /benchmark/ICSharpCode.SharpZipLib.Benchmark/Checksum/Crc32.cs: -------------------------------------------------------------------------------- 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(data, ChunkSize * i, ChunkSize); 37 | crc32.Update(segment); 38 | } 39 | 40 | return crc32.Value; 41 | } 42 | */ 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /benchmark/ICSharpCode.SharpZipLib.Benchmark/BZip2/BZip2InputStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using BenchmarkDotNet.Attributes; 4 | 5 | namespace ICSharpCode.SharpZipLib.Benchmark.BZip2 6 | { 7 | [Config(typeof(MultipleRuntimes))] 8 | public class BZip2InputStream 9 | { 10 | private byte[] compressedData; 11 | 12 | public BZip2InputStream() 13 | { 14 | var outputMemoryStream = new MemoryStream(); 15 | using (var outputStream = new SharpZipLib.BZip2.BZip2OutputStream(outputMemoryStream)) 16 | { 17 | var random = new Random(1234); 18 | var inputData = new byte[1024 * 1024 * 30]; 19 | random.NextBytes(inputData); 20 | var inputMemoryStream = new MemoryStream(inputData); 21 | inputMemoryStream.CopyTo(outputStream); 22 | } 23 | 24 | compressedData = outputMemoryStream.ToArray(); 25 | } 26 | 27 | [Benchmark] 28 | public void DecompressData() 29 | { 30 | var memoryStream = new MemoryStream(compressedData); 31 | using (var inputStream = new SharpZipLib.BZip2.BZip2InputStream(memoryStream)) 32 | { 33 | inputStream.CopyTo(Stream.Null); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /benchmark/ICSharpCode.SharpZipLib.Benchmark/Checksum/Adler32.cs: -------------------------------------------------------------------------------- 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(data, ChunkSize * i, ChunkSize); 37 | adler32.Update(segment); 38 | } 39 | 40 | return adler32.Value; 41 | } 42 | */ 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/vb/SampleAssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System.Reflection 2 | Imports System.Runtime.InteropServices 3 | 4 | ' General Information about an assembly is controlled through the following 5 | ' set of attributes. Change these attribute values to modify the information 6 | ' associated with an assembly. 7 | 8 | ' Review the values of the assembly attributes 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ' Version information for an assembly consists of the following four values: 19 | ' 20 | ' Major Version 21 | ' Minor Version 22 | ' Build Number 23 | ' Revision 24 | ' 25 | ' You can specify all the values or you can default the Build and Revision Numbers 26 | ' by using the '*' as shown below: 27 | ' 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /benchmark/ICSharpCode.SharpZipLib.Benchmark/Checksum/BZip2Crc.cs: -------------------------------------------------------------------------------- 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(data, ChunkSize * i, ChunkSize); 37 | bzipCrc.Update(segment); 38 | } 39 | 40 | return bzipCrc.Value; 41 | } 42 | */ 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /docs/future/FILEFMTS_HYP.md: -------------------------------------------------------------------------------- 1 | --------A-HYP------------------------------- 2 | The Hyper archiver is a very fast compression program by P. Sawatzki and K.P. 3 | Nischke, which uses LZW compression techniques for compression. It is not very 4 | widespread - in fact, I've yet to see a package distributed in this format. 5 | 6 | OFFSET Count TYPE Description 7 | 0000h 1 byte ID=1Ah 8 | 0001h 2 char Compression method 9 | "HP" - compressed 10 | "ST" - stored 11 | 0003h 1 byte Version file was compressed by in BCD 12 | 0004h 1 dword Compressed file size 13 | 0008h 1 dword Original file size 14 | 000Ch 1 dword MS-DOS date and time of file (see table 0009) 15 | 0010h 1 dword CRC-32 of file 16 | 0014h 1 byte MS-DOS file attribute 17 | 0015h 1 byte Length of filename 18 | ="LEN" 19 | 0016h "LEN" char Filename 20 | 21 | EXTENSION:HYP 22 | OCCURENCES:PC 23 | PROGRAMS:HYPER.EXE 24 | -------------------------------------------------------------------------------- /tools/release-notes/release-notes-md.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | const typeGroups = { 3 | feats: { title: 'Features:', types: ['feat'] }, 4 | fixes: { title: 'Fixes:', types: ['fix'] }, 5 | etc: { 6 | title: 'Other changes (not related to library code):', 7 | types: ['docs','style','refactor','perf','test','build','ci','chore'] 8 | }, 9 | unknown: { title: 'Unknown:', types: ['?'] }, 10 | } 11 | 12 | const commitTypes = { 13 | feat: '✨', fix: '🐛', docs: '📚', style: '💎', 14 | refactor: '🔨', perf: '🚀', test: '🚨', build: '📦', 15 | ci: '⚙️', chore: '🔧', ['?']: '❓', 16 | } 17 | 18 | for(const group of Object.values(typeGroups)){ 19 | const groupCommits = commits.filter(c => group.types.includes(c.type)); 20 | if (groupCommits.length < 1) continue; 21 | %> 22 | ## <%=group.title%> 23 | <% for (const {issue, title, authorName, authorUser, scope, type} of groupCommits) { %> 24 | * <%=commitTypes[type]%> 25 | <%=issue ? ` [[#${issue}](https://github.com/icsharpcode/SharpZipLib/pull/${issue})]\n` : ''-%> 26 | <%=scope ? ` \`${scope}\`\n` : ''-%> 27 | __<%=title-%>__ 28 | by <%=authorUser ? `[_${authorName}_](https://github.com/${authorUser})` : `_${authorName}_`%> 29 | <% } %> 30 | 31 | <% } %> 32 | -------------------------------------------------------------------------------- /src/ICSharpCode.SharpZipLib/Zip/ZipEntryExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ICSharpCode.SharpZipLib.Zip 6 | { 7 | /// 8 | /// General ZipEntry helper extensions 9 | /// 10 | public static class ZipEntryExtensions 11 | { 12 | /// 13 | /// Efficiently check if a flag is set without enum un-/boxing 14 | /// 15 | /// 16 | /// 17 | /// Returns whether the flag was set 18 | public static bool HasFlag(this ZipEntry entry, GeneralBitFlags flag) 19 | => (entry.Flags & (int) flag) != 0; 20 | 21 | /// 22 | /// Efficiently set a flag without enum un-/boxing 23 | /// 24 | /// 25 | /// 26 | /// Whether the passed flag should be set (1) or cleared (0) 27 | public static void SetFlag(this ZipEntry entry, GeneralBitFlags flag, bool enabled = true) 28 | => entry.Flags = enabled 29 | ? entry.Flags | (int) flag 30 | : entry.Flags & ~(int) flag; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tools/old/run-appveyor-build.ps1: -------------------------------------------------------------------------------- 1 | # Define build command. 2 | $buildCmd = "C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe"; 3 | $buildArgs = @( 4 | "ICSharpCode.SharpZipLib.sln" 5 | "/l:C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll", 6 | "/m", 7 | "/p:UseSharedCompilation=false", 8 | "/p:Configuration=Release", 9 | "/p:Platform=Any CPU"); 10 | 11 | # If build is not a scheduled one, then simply build the project with MSBuild. 12 | if ($env:APPVEYOR_SCHEDULED_BUILD -ne "True") { 13 | & $buildCmd $buildArgs 14 | # & nuget pack -OutputDirectory 15 | return # exit script 16 | } 17 | 18 | # Else, build project with Coverity Scan. 19 | $publishCoverityExe = $env:APPVEYOR_BUILD_FOLDER + "\packages\PublishCoverity.0.11.0\tools\PublishCoverity.exe"; 20 | "Building project with Coverity Scan..." 21 | & cov-build --dir Documentation\cov-int $buildCmd $buildArgs; 22 | 23 | # Compress scan data. 24 | & $publishCoverityExe compress -o Documentation\coverity.zip -i Documentation\cov-int; 25 | 26 | # Upload scan data. 27 | & $publishCoverityExe publish -z Documentation\coverity.zip -r McNeight/SharpZipLib -t $env:Coverity_Token -e $env:Coverity_Email -d "AppVeyor scheduled build"; 28 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/vb/CreateZipFile/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/opencover/ICSharpCode.SharpZipLib_ProgressHandler.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ICSharpCode.SharpZipLib.Core.ProgressHandler - Coverage Report 6 | 7 |
8 |

Summary

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
Class:ICSharpCode.SharpZipLib.Core.ProgressHandler
Assembly:ICSharpCode.SharpZipLib
File(s):
Covered lines:0
Uncovered lines:0
Coverable lines:0
Total lines:0
Line coverage:
25 |

File(s)

26 |

No files found. This usually happens if a file isn't covered by a test or the class does not contain any sequence points (e.g. a class that only contains auto properties).

27 |
28 | 29 | -------------------------------------------------------------------------------- /test/ICSharpCode.SharpZipLib.Tests/ICSharpCode.SharpZipLib.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Library 5 | net6.0;net462 6 | 7 | 8 | true 9 | ..\..\assets\ICSharpCode.SharpZipLib.snk 10 | true 11 | 8.0 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | ICSharpCode.SharpZipLib.snk 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/cs/unzipfile/UnZipFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using ICSharpCode.SharpZipLib.Zip; 4 | 5 | 6 | class UnZipFileClass 7 | { 8 | public static void Main(string[] args) 9 | { 10 | // Perform simple parameter checking. 11 | if ( args.Length < 1 ) { 12 | Console.WriteLine("Usage UnzipFile NameOfFile"); 13 | return; 14 | } 15 | 16 | if ( !File.Exists(args[0]) ) { 17 | Console.WriteLine("Cannot find file '{0}'", args[0]); 18 | return; 19 | } 20 | 21 | using (ZipInputStream s = new ZipInputStream(File.OpenRead(args[0]))) { 22 | 23 | ZipEntry theEntry; 24 | while ((theEntry = s.GetNextEntry()) != null) { 25 | 26 | Console.WriteLine(theEntry.Name); 27 | 28 | string directoryName = Path.GetDirectoryName(theEntry.Name); 29 | string fileName = Path.GetFileName(theEntry.Name); 30 | 31 | // create directory 32 | if ( directoryName.Length > 0 ) { 33 | Directory.CreateDirectory(directoryName); 34 | } 35 | 36 | if (fileName != String.Empty) { 37 | using (FileStream streamWriter = File.Create(theEntry.Name)) { 38 | 39 | int size = 2048; 40 | byte[] data = new byte[2048]; 41 | while (true) { 42 | size = s.Read(data, 0, data.Length); 43 | if (size > 0) { 44 | streamWriter.Write(data, 0, size); 45 | } else { 46 | break; 47 | } 48 | } 49 | } 50 | } 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /docs/opencover/ICSharpCode.SharpZipLib_FileFailureHandler.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ICSharpCode.SharpZipLib.Core.FileFailureHandler - Coverage Report 6 | 7 |
8 |

Summary

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
Class:ICSharpCode.SharpZipLib.Core.FileFailureHandler
Assembly:ICSharpCode.SharpZipLib
File(s):
Covered lines:0
Uncovered lines:0
Coverable lines:0
Total lines:0
Line coverage:
25 |

File(s)

26 |

No files found. This usually happens if a file isn't covered by a test or the class does not contain any sequence points (e.g. a class that only contains auto properties).

27 |
28 | 29 | -------------------------------------------------------------------------------- /docs/opencover/ICSharpCode.SharpZipLib_ProcessFileHandler.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ICSharpCode.SharpZipLib.Core.ProcessFileHandler - Coverage Report 6 | 7 |
8 |

Summary

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
Class:ICSharpCode.SharpZipLib.Core.ProcessFileHandler
Assembly:ICSharpCode.SharpZipLib
File(s):
Covered lines:0
Uncovered lines:0
Coverable lines:0
Total lines:0
Line coverage:
25 |

File(s)

26 |

No files found. This usually happens if a file isn't covered by a test or the class does not contain any sequence points (e.g. a class that only contains auto properties).

27 |
28 | 29 | -------------------------------------------------------------------------------- /docs/opencover/ICSharpCode.SharpZipLib_CompletedFileHandler.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ICSharpCode.SharpZipLib.Core.CompletedFileHandler - Coverage Report 6 | 7 |
8 |

Summary

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
Class:ICSharpCode.SharpZipLib.Core.CompletedFileHandler
Assembly:ICSharpCode.SharpZipLib
File(s):
Covered lines:0
Uncovered lines:0
Coverable lines:0
Total lines:0
Line coverage:
25 |

File(s)

26 |

No files found. This usually happens if a file isn't covered by a test or the class does not contain any sequence points (e.g. a class that only contains auto properties).

27 |
28 | 29 | -------------------------------------------------------------------------------- /docs/opencover/ICSharpCode.SharpZipLib_ZipTestResultHandler.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ICSharpCode.SharpZipLib.Zip.ZipTestResultHandler - Coverage Report 6 | 7 |
8 |

Summary

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
Class:ICSharpCode.SharpZipLib.Zip.ZipTestResultHandler
Assembly:ICSharpCode.SharpZipLib
File(s):
Covered lines:0
Uncovered lines:0
Coverable lines:0
Total lines:0
Line coverage:
25 |

File(s)

26 |

No files found. This usually happens if a file isn't covered by a test or the class does not contain any sequence points (e.g. a class that only contains auto properties).

27 |
28 | 29 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/vb/viewzipfile/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/opencover/ICSharpCode.SharpZipLib_ProgressMessageHandler.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ICSharpCode.SharpZipLib.Tar.ProgressMessageHandler - Coverage Report 6 | 7 |
8 |

Summary

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
Class:ICSharpCode.SharpZipLib.Tar.ProgressMessageHandler
Assembly:ICSharpCode.SharpZipLib
File(s):
Covered lines:0
Uncovered lines:0
Coverable lines:0
Total lines:0
Line coverage:
25 |

File(s)

26 |

No files found. This usually happens if a file isn't covered by a test or the class does not contain any sequence points (e.g. a class that only contains auto properties).

27 |
28 | 29 | -------------------------------------------------------------------------------- /docs/opencover/ICSharpCode.SharpZipLib_DirectoryFailureHandler.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ICSharpCode.SharpZipLib.Core.DirectoryFailureHandler - Coverage Report 6 | 7 |
8 |

Summary

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
Class:ICSharpCode.SharpZipLib.Core.DirectoryFailureHandler
Assembly:ICSharpCode.SharpZipLib
File(s):
Covered lines:0
Uncovered lines:0
Coverable lines:0
Total lines:0
Line coverage:
25 |

File(s)

26 |

No files found. This usually happens if a file isn't covered by a test or the class does not contain any sequence points (e.g. a class that only contains auto properties).

27 |
28 | 29 | -------------------------------------------------------------------------------- /docs/future/FILEFMTS_GZIP.md: -------------------------------------------------------------------------------- 1 | --------A-GZIP------------------------------ 2 | The GNU ZIP program is an archive program mostly for the UNIX machines developed 3 | by the GNU project. 4 | OFFSET Count TYPE Description 5 | 0000h 2 char ID='!',139 6 | 0002h 1 byte Method : 7 | 0-7 - reserved 8 | 8 - deflated 9 | 0003h 1 byte File flags : 10 | 0 - ASCII-text 11 | 1 - Multi-part file 12 | 2 - Name present 13 | 3 - Comment present 14 | 4 - Encrypted 15 | 5-8 - reserved 16 | 0004h 1 dword File date and time (see table 0009) 17 | 0008h 1 byte Extra flags 18 | 0009h 1 byte Target OS : 19 | 0 - DOS 20 | 1 - Amiga 21 | 2 - VMS 22 | 3 - Unix 23 | 4 - ???? 24 | 5 - Atari 25 | 6 - OS/2 26 | 7 - MacOS 27 | 10 - TOPS-20 28 | 11 - Win/32 29 | EXTENSION:ZIP 30 | PROGRAMS:GNU gzip 31 | -------------------------------------------------------------------------------- /benchmark/ICSharpCode.SharpZipLib.Benchmark/Zip/ZipInputStream.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using BenchmarkDotNet.Attributes; 3 | 4 | namespace ICSharpCode.SharpZipLib.Benchmark.Zip 5 | { 6 | [MemoryDiagnoser] 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 | byte[] readBuffer = new byte[4096]; 16 | 17 | [GlobalSetup] 18 | public void GlobalSetup() 19 | { 20 | using (var memoryStream = new MemoryStream()) 21 | { 22 | using (var zipOutputStream = new SharpZipLib.Zip.ZipOutputStream(memoryStream)) 23 | { 24 | zipOutputStream.PutNextEntry(new SharpZipLib.Zip.ZipEntry("0")); 25 | 26 | var inputBuffer = new byte[ChunkSize]; 27 | 28 | for (int i = 0; i < ChunkCount; i++) 29 | { 30 | zipOutputStream.Write(inputBuffer, 0, inputBuffer.Length); 31 | } 32 | } 33 | 34 | zippedData = memoryStream.ToArray(); 35 | } 36 | } 37 | 38 | [Benchmark] 39 | public long ReadZipInputStream() 40 | { 41 | using (var memoryStream = new MemoryStream(zippedData)) 42 | { 43 | using (var zipInputStream = new SharpZipLib.Zip.ZipInputStream(memoryStream)) 44 | { 45 | var entry = zipInputStream.GetNextEntry(); 46 | 47 | while (zipInputStream.Read(readBuffer, 0, readBuffer.Length) > 0) 48 | { 49 | 50 | } 51 | 52 | return entry.Size; 53 | } 54 | } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/ICSharpCode.SharpZipLib/Checksum/IChecksum.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ICSharpCode.SharpZipLib.Checksum 4 | { 5 | /// 6 | /// Interface to compute a data checksum used by checked input/output streams. 7 | /// A data checksum can be updated by one byte or with a byte array. After each 8 | /// update the value of the current checksum can be returned by calling 9 | /// getValue. The complete checksum object can also be reset 10 | /// so it can be used again with new data. 11 | /// 12 | public interface IChecksum 13 | { 14 | /// 15 | /// Resets the data checksum as if no update was ever called. 16 | /// 17 | void Reset(); 18 | 19 | /// 20 | /// Returns the data checksum computed so far. 21 | /// 22 | long Value 23 | { 24 | get; 25 | } 26 | 27 | /// 28 | /// Adds one byte to the data checksum. 29 | /// 30 | /// 31 | /// the data value to add. The high byte of the int is ignored. 32 | /// 33 | void Update(int bval); 34 | 35 | /// 36 | /// Updates the data checksum with the bytes taken from the array. 37 | /// 38 | /// 39 | /// buffer an array of bytes 40 | /// 41 | void Update(byte[] buffer); 42 | 43 | /// 44 | /// Adds the byte array to the data checksum. 45 | /// 46 | /// 47 | /// The chunk of data to add 48 | /// 49 | void Update(ArraySegment segment); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: 💡 Feature request 2 | description: Have a new idea/feature ? Please suggest! 3 | labels: ["enhancement"] 4 | body: 5 | - type: textarea 6 | id: description 7 | attributes: 8 | label: Is your feature request related to a problem? Please describe. 9 | description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 10 | validations: 11 | required: true 12 | 13 | - type: textarea 14 | id: solution 15 | attributes: 16 | label: Describe the solution you'd like 17 | description: A clear and concise description of what you want to happen. 18 | validations: 19 | required: true 20 | 21 | - type: textarea 22 | id: alternatives 23 | attributes: 24 | label: Describe alternatives you've considered 25 | description: A clear and concise description of any alternative solutions or features you've considered. 26 | validations: 27 | required: true 28 | 29 | - id: tags 30 | type: dropdown 31 | attributes: 32 | label: Tags 33 | description: What areas are your feature request related to? 34 | multiple: true 35 | options: 36 | - ZIP 37 | - GZip 38 | - Tar 39 | - BZip2 40 | - Encoding 41 | - Encryption 42 | - Documentation 43 | - Async 44 | - Performance 45 | 46 | - type: textarea 47 | id: extrainfo 48 | attributes: 49 | label: Additional context 50 | description: Add any other context or screenshots about the feature request here. 51 | validations: 52 | required: false 53 | -------------------------------------------------------------------------------- /docs/future/FILEFMTS_LZH.md: -------------------------------------------------------------------------------- 1 | LZH 2 | === 3 | 4 | The LHArc/LHA archiver is a multi platform archiver made by Haruyasu Yoshizaki, 5 | which has a relatively good compression. It uses more or less the same 6 | technology like the ZIP programs by Phil Katz. There was a hack named "ICE", 7 | which had only the graphic characters displayed on decompression changed. 8 | 9 | ``` 10 | OFFSET Count TYPE Description 11 | 0000h 1 byte Size of archived file header 12 | 0001h 1 byte Checksum of remaining bytes 13 | 0002h 3 char ID='-lh' 14 | ID='-lz' 15 | 0005h 1 char Compression methods used (see table 0005) 16 | 0006h 1 char ID='-' 17 | 0007h 1 dword Compressed size 18 | 000Bh 1 dword Uncompressed size 19 | 000Fh 1 dword Original file date/time (see table 0009) 20 | 0013h 1 word File attribute 21 | 0015h 1 byte Filename / path length in bytes 22 | ="LEN" 23 | 0016h "LEN" char Filename / path 24 | 0018h 1 word CRC-16 of original file 25 | +"LEN" 26 | 27 | (Table 0005) 28 | LHArc compression types 29 | "0" - No compression 30 | "1" - LZW, 4K buffer, Huffman for upper 6 bits of position 31 | "2" - unknown 32 | "3" - unknown 33 | "4" - LZW, Arithmetic Encoding 34 | "5" - LZW, Arithmetic Encoding 35 | "s" - LHa 2.x archive? 36 | "\" - LHa 2.x archive? 37 | "d" - LHa 2.x archive? 38 | 39 | EXTENSION:LZH,ICE 40 | OCCURENCES:PC 41 | PROGRAMS:LHArc.EXE, LHA.EXE 42 | ``` 43 | -------------------------------------------------------------------------------- /samples/ICSharpCode.SharpZipLib.Samples/vb/WpfCreateZipFile/WpfCreateZipFileWindow.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |