├── .editorconfig
├── .gitattributes
├── .github
├── dependabot.yml
└── workflows
│ ├── build-and-test.yml
│ └── codeql-analysis.yml
├── .gitignore
├── .gitmodules
├── Directory.Build.props
├── Directory.Build.targets
├── LICENSE
├── NuGet.config
├── THIRD-PARTY-NOTICES.txt
├── ZlibStream.sln
├── benchmarks.md
├── ci-build.ps1
├── ci-pack.ps1
├── ci-test.ps1
├── readme.md
├── src
├── Directory.Build.props
├── Directory.Build.targets
└── ZlibStream
│ ├── Adler32.cs
│ ├── ArrayExtensions.cs
│ ├── CompressionLevel.cs
│ ├── CompressionState.cs
│ ├── CompressionStrategy.cs
│ ├── Deflate.Buffers.cs
│ ├── Deflate.Fast.cs
│ ├── Deflate.Intrinsics.cs
│ ├── Deflate.Quick.cs
│ ├── Deflate.Rle.cs
│ ├── Deflate.Slow.cs
│ ├── Deflate.Stored.cs
│ ├── Deflate.cs
│ ├── FlushMode.cs
│ ├── InfCodes.cs
│ ├── InfTree.cs
│ ├── Inflate.cs
│ ├── InflateBlocks.cs
│ ├── InliningOptions.cs
│ ├── SerializableAttribute.cs
│ ├── StreamExtensions.cs
│ ├── ThrowHelper.cs
│ ├── Trees.Dynamic.cs
│ ├── Trees.Static.cs
│ ├── Trees.cs
│ ├── ZlibInputStream.cs
│ ├── ZlibOptions.cs
│ ├── ZlibOutputStream.cs
│ ├── ZlibStream.cs
│ ├── ZlibStream.csproj
│ └── ZlibStreamException.cs
├── stylecop.json
└── tests
├── Directory.Build.props
├── Directory.Build.targets
├── ZlibStream.Benchmarks
├── Adler32Benchmark.cs
├── BinaryPrimitiveBenchmarks.cs
├── Config.cs
├── DeflateCorpusBenchmark.cs
├── DeflateSparseBenchmark.cs
├── DotNetZlibDeflateStream.cs
├── Program.cs
└── ZlibStream.Benchmarks.csproj
├── ZlibStream.Tests
├── Adler32Tests.cs
├── TestUtilities
│ ├── Corpus.cs
│ └── TestEnvironment.cs
├── ZlibStream.Tests.csproj
├── ZlibStreamTests.Roundtrip.cs
└── xunit.runner.json
├── corpus
├── alice29.txt
├── asyoulik.txt
├── cp.html
├── fields.c
├── grammar.lsp
├── kennedy.xls
├── lcet10.txt
├── plrabn12.txt
├── ptt5
├── sum
└── xargs.1
└── coverlet.runsettings
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to:
3 | # treat as text and
4 | # normalize to Unix-style line endings
5 | ###############################################################################
6 | * text eol=lf
7 | ###############################################################################
8 | # Set explicit file behavior to:
9 | # treat as text and
10 | # normalize to Unix-style line endings
11 | ###############################################################################
12 | *.asm text eol=lf
13 | *.c text eol=lf
14 | *.clj text eol=lf
15 | *.cmd text eol=lf
16 | *.cpp text eol=lf
17 | *.css text eol=lf
18 | *.cxx text eol=lf
19 | *.config text eol=lf
20 | *.DotSettings text eol=lf
21 | *.erl text eol=lf
22 | *.fs text eol=lf
23 | *.fsx text eol=lf
24 | *.h text eol=lf
25 | *.htm text eol=lf
26 | *.html text eol=lf
27 | *.hs text eol=lf
28 | *.hxx text eol=lf
29 | *.java text eol=lf
30 | *.js text eol=lf
31 | *.json text eol=lf
32 | *.less text eol=lf
33 | *.lisp text eol=lf
34 | *.lua text eol=lf
35 | *.m text eol=lf
36 | *.md text eol=lf
37 | *.php text eol=lf
38 | *.props text eol=lf
39 | *.ps1 text eol=lf
40 | *.py text eol=lf
41 | *.rb text eol=lf
42 | *.resx text eol=lf
43 | *.runsettings text eol=lf
44 | *.ruleset text eol=lf
45 | *.sass text eol=lf
46 | *.scss text eol=lf
47 | *.sh text eol=lf
48 | *.sql text eol=lf
49 | *.svg text eol=lf
50 | *.targets text eol=lf
51 | *.tt text eol=crlf
52 | *.ttinclude text eol=crlf
53 | *.txt text eol=lf
54 | *.vb text eol=lf
55 | *.yml text eol=lf
56 | ###############################################################################
57 | # Set explicit file behavior to:
58 | # treat as text
59 | # normalize to Unix-style line endings and
60 | # diff as csharp
61 | ###############################################################################
62 | *.cs text eol=lf diff=csharp
63 | ###############################################################################
64 | # Set explicit file behavior to:
65 | # treat as text
66 | # normalize to Unix-style line endings and
67 | # use a union merge when resoling conflicts
68 | ###############################################################################
69 | *.csproj text eol=lf merge=union
70 | *.dbproj text eol=lf merge=union
71 | *.fsproj text eol=lf merge=union
72 | *.ncrunchproject text eol=lf merge=union
73 | *.vbproj text eol=lf merge=union
74 | ###############################################################################
75 | # Set explicit file behavior to:
76 | # treat as text
77 | # normalize to Windows-style line endings and
78 | # use a union merge when resoling conflicts
79 | ###############################################################################
80 | *.sln text eol=crlf merge=union
81 | ###############################################################################
82 | # Set explicit file behavior to:
83 | # treat as binary
84 | ###############################################################################
85 | *.basis binary
86 | *.dll binary
87 | *.eot binary
88 | *.exe binary
89 | *.otf binary
90 | *.pbm binary
91 | *.pdf binary
92 | *.ppt binary
93 | *.pptx binary
94 | *.pvr binary
95 | *.snk binary
96 | *.ttc binary
97 | *.ttf binary
98 | *.wbmp binary
99 | *.woff binary
100 | *.woff2 binary
101 | *.xls binary
102 | *.xlsx binary
103 | ###############################################################################
104 | # Set explicit file behavior to:
105 | # diff as plain text
106 | ###############################################################################
107 | *.doc diff=astextplain
108 | *.docx diff=astextplain
109 | *.dot diff=astextplain
110 | *.pdf diff=astextplain
111 | *.pptx diff=astextplain
112 | *.rtf diff=astextplain
113 | *.svg diff=astextplain
114 | ###############################################################################
115 | # Handle image files by git lfs
116 | ###############################################################################
117 | *.jpg filter=lfs diff=lfs merge=lfs -text
118 | *.jpeg filter=lfs diff=lfs merge=lfs -text
119 | *.bmp filter=lfs diff=lfs merge=lfs -text
120 | *.gif filter=lfs diff=lfs merge=lfs -text
121 | *.png filter=lfs diff=lfs merge=lfs -text
122 | *.tif filter=lfs diff=lfs merge=lfs -text
123 | *.tiff filter=lfs diff=lfs merge=lfs -text
124 | *.tga filter=lfs diff=lfs merge=lfs -text
125 | *.webp filter=lfs diff=lfs merge=lfs -text
126 | *.dds filter=lfs diff=lfs merge=lfs -text
127 | *.ktx filter=lfs diff=lfs merge=lfs -text
128 | *.ktx2 filter=lfs diff=lfs merge=lfs -text
129 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: "github-actions"
4 | directory: "/"
5 | schedule:
6 | interval: "weekly"
7 |
--------------------------------------------------------------------------------
/.github/workflows/build-and-test.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | tags:
8 | - "v*"
9 | pull_request:
10 | branches:
11 | - main
12 | jobs:
13 | Build:
14 | strategy:
15 | matrix:
16 | options:
17 | - os: ubuntu-latest
18 | framework: net5.0
19 | runtime: -x64
20 | codecov: false
21 | - os: macos-latest
22 | framework: net5.0
23 | runtime: -x64
24 | codecov: false
25 | - os: windows-latest
26 | framework: net5.0
27 | runtime: -x64
28 | codecov: false
29 | - os: ubuntu-latest
30 | framework: netcoreapp3.1
31 | runtime: -x64
32 | codecov: true
33 | - os: macos-latest
34 | framework: netcoreapp3.1
35 | runtime: -x64
36 | codecov: false
37 | - os: windows-latest
38 | framework: netcoreapp3.1
39 | runtime: -x64
40 | codecov: false
41 | - os: windows-latest
42 | framework: netcoreapp2.1
43 | runtime: -x64
44 | codecov: false
45 | - os: windows-latest
46 | framework: net472
47 | runtime: -x64
48 | codecov: false
49 | - os: windows-latest
50 | framework: net472
51 | runtime: -x86
52 | codecov: false
53 |
54 | runs-on: ${{matrix.options.os}}
55 | if: "!contains(github.event.head_commit.message, '[skip ci]')"
56 |
57 | steps:
58 | - uses: actions/checkout@v3
59 |
60 | # See https://github.com/actions/checkout/issues/165#issuecomment-657673315
61 | - name: Create LFS file list
62 | run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
63 |
64 | - name: Restore LFS cache
65 | uses: actions/cache@v3
66 | id: lfs-cache
67 | with:
68 | path: .git/lfs
69 | key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1
70 |
71 | - name: Git LFS Pull
72 | run: git lfs pull
73 |
74 | - name: Install NuGet
75 | uses: NuGet/setup-nuget@v1
76 |
77 | - name: Setup Git
78 | shell: bash
79 | run: |
80 | git config --global core.autocrlf false
81 | git config --global core.longpaths true
82 | git fetch --prune --unshallow
83 | git submodule -q update --init --recursive
84 |
85 | - name: Setup NuGet Cache
86 | uses: actions/cache@v3
87 | id: nuget-cache
88 | with:
89 | path: ~/.nuget
90 | key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
91 | restore-keys: ${{ runner.os }}-nuget-
92 |
93 | - name: DotNet Setup
94 | uses: actions/setup-dotnet@v2
95 | with:
96 | dotnet-version: |
97 | 5.0.x
98 | 3.1.x
99 | 2.1.x
100 |
101 | - name: Build
102 | shell: pwsh
103 | run: ./ci-build.ps1 "${{matrix.options.framework}}"
104 | env:
105 | SIXLABORS_TESTING: True
106 |
107 | - name: Test
108 | shell: pwsh
109 | run: ./ci-test.ps1 "${{matrix.options.os}}" "${{matrix.options.framework}}" "${{matrix.options.runtime}}" "${{matrix.options.codecov}}"
110 | env:
111 | SIXLABORS_TESTING: True
112 | XUNIT_PATH: .\tests\ZLibStream.Tests # Required for xunit
113 |
114 | - name: Update Codecov
115 | uses: codecov/codecov-action@v3
116 | if: matrix.options.codecov == true && startsWith(github.repository, 'SixLabors')
117 | with:
118 | flags: unittests
119 |
120 | Publish:
121 | needs: [Build]
122 |
123 | runs-on: windows-latest
124 |
125 | if: (github.event_name == 'push')
126 |
127 | steps:
128 | - uses: actions/checkout@v3
129 |
130 | - name: Install NuGet
131 | uses: NuGet/setup-nuget@v1
132 |
133 | - name: Setup Git
134 | shell: bash
135 | run: |
136 | git config --global core.autocrlf false
137 | git config --global core.longpaths true
138 | git fetch --prune --unshallow
139 | git submodule -q update --init --recursive
140 |
141 | - name: Pack
142 | shell: pwsh
143 | run: ./ci-pack.ps1
144 |
145 | - name: Publish to MyGet
146 | shell: pwsh
147 | run: |
148 | nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package
149 | nuget.exe push .\artifacts\*.snupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v3/index.json
150 | # TODO: If github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org
151 |
--------------------------------------------------------------------------------
/.github/workflows/codeql-analysis.yml:
--------------------------------------------------------------------------------
1 | # For most projects, this workflow file will not need changing; you simply need
2 | # to commit it to your repository.
3 | #
4 | # You may wish to alter this file to override the set of languages analyzed,
5 | # or to provide custom queries or build logic.
6 | name: "CodeQL"
7 |
8 | on:
9 | push:
10 | branches: [main]
11 | pull_request:
12 | # The branches below must be a subset of the branches above
13 | branches: [main]
14 | schedule:
15 | - cron: '0 13 * * 4'
16 |
17 | jobs:
18 | analyze:
19 | name: Analyze
20 | runs-on: ubuntu-latest
21 |
22 | strategy:
23 | fail-fast: false
24 | matrix:
25 | # Override automatic language detection by changing the below list
26 | # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
27 | language: ['csharp']
28 | # Learn more...
29 | # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
30 |
31 | steps:
32 | - name: Checkout repository
33 | uses: actions/checkout@v3
34 | with:
35 | submodules: true
36 |
37 | # Initializes the CodeQL tools for scanning.
38 | - name: Initialize CodeQL
39 | uses: github/codeql-action/init@v2
40 | with:
41 | languages: ${{ matrix.language }}
42 | # If you wish to specify custom queries, you can do so here or in a config file.
43 | # By default, queries listed here will override any specified in a config file.
44 | # Prefix the list here with "+" to use these queries and those in the config file.
45 | # queries: ./path/to/local/query, your-org/your-repo/queries@main
46 |
47 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
48 | # If this step fails, then you should remove it and run the build manually (see below)
49 | - name: Autobuild
50 | uses: github/codeql-action/autobuild@v2
51 |
52 | # ℹ️ Command-line programs to run using the OS shell.
53 | # 📚 https://git.io/JvXDl
54 |
55 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
56 | # and modify them (or add more) to build your code if your project
57 | # uses a compiled language
58 |
59 | #- run: |
60 | # make bootstrap
61 | # make release
62 |
63 | - name: Perform CodeQL Analysis
64 | uses: github/codeql-action/analyze@v2
65 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | src/**/build/
21 | tests/**/build/
22 | bld/
23 | [Bb]in/
24 | [Oo]bj/
25 |
26 | # Visual Studo 2015 cache/options directory
27 | .vs/
28 |
29 | # Jetbrains Rider cache/options directory
30 | .idea/
31 |
32 | # MSTest test Results
33 | [Tt]est[Rr]esult*/
34 | [Bb]uild[Ll]og.*
35 |
36 | # NUNIT
37 | *.VisualState.xml
38 | TestResult.xml
39 |
40 | # Build Results of an ATL Project
41 | [Dd]ebugPS/
42 | [Rr]eleasePS/
43 | dlldata.c
44 |
45 | # ASP.NET 5
46 | project.lock.json
47 | artifacts/
48 |
49 | *_i.c
50 | *_p.c
51 | *_i.h
52 | *.ilk
53 | *.meta
54 | *.obj
55 | *.pch
56 | *.pdb
57 | *.pgc
58 | *.pgd
59 | *.rsp
60 | *.sbr
61 | *.tlb
62 | *.tli
63 | *.tlh
64 | *.tmp
65 | *.tmp_proj
66 | *.log
67 | *.vspscc
68 | *.vssscc
69 | .builds
70 | *.pidb
71 | *.svclog
72 | *.scc
73 |
74 | # Chutzpah Test files
75 | _Chutzpah*
76 |
77 | # Visual C++ cache files
78 | ipch/
79 | *.aps
80 | *.ncb
81 | *.opensdf
82 | *.sdf
83 | *.cachefile
84 |
85 | # Visual Studio profiler
86 | *.psess
87 | *.vsp
88 | *.vspx
89 |
90 | # TFS 2012 Local Workspace
91 | $tf/
92 |
93 | # Guidance Automation Toolkit
94 | *.gpState
95 |
96 | # ReSharper is a .NET coding add-in
97 | _ReSharper*/
98 | *.[Rr]e[Ss]harper
99 | *.DotSettings.user
100 |
101 | # JustCode is a .NET coding addin-in
102 | .JustCode
103 |
104 | # TeamCity is a build add-in
105 | _TeamCity*
106 |
107 | # DotCover is a Code Coverage Tool
108 | *.dotCover
109 |
110 | # NCrunch
111 | _NCrunch_*
112 | .*crunch*.local.xml
113 |
114 | # MightyMoose
115 | *.mm.*
116 | AutoTest.Net/
117 |
118 | # Web workbench (sass)
119 | .sass-cache/
120 |
121 | # Installshield output folder
122 | [Ee]xpress/
123 |
124 | # DocProject is a documentation generator add-in
125 | DocProject/buildhelp/
126 | DocProject/Help/*.HxT
127 | DocProject/Help/*.HxC
128 | DocProject/Help/*.hhc
129 | DocProject/Help/*.hhk
130 | DocProject/Help/*.hhp
131 | DocProject/Help/Html2
132 | DocProject/Help/html
133 |
134 | # Click-Once directory
135 | publish/
136 |
137 | # Publish Web Output
138 | *.[Pp]ublish.xml
139 | *.azurePubxml
140 | # TODO: Comment the next line if you want to checkin your web deploy settings
141 | # but database connection strings (with potential passwords) will be unencrypted
142 | *.pubxml
143 | *.publishproj
144 |
145 | # NuGet Packages
146 | *.nupkg
147 | # The packages folder can be ignored because of Package Restore
148 | **/packages/*
149 | # except build/, which is used as an MSBuild target.
150 | !**/packages/build/
151 | # Uncomment if necessary however generally it will be regenerated when needed
152 | #!**/packages/repositories.config
153 |
154 | # Windows Azure Build Output
155 | csx/
156 | *.build.csdef
157 |
158 | # Windows Store app package directory
159 | AppPackages/
160 |
161 | # Others
162 | *.[Cc]ache
163 | ClientBin/
164 | ~$*
165 | *~
166 | *.dbmdl
167 | *.dbproj.schemaview
168 | *.pfx
169 | *.publishsettings
170 | node_modules/
171 | bower_components/
172 |
173 | # RIA/Silverlight projects
174 | Generated_Code/
175 |
176 | # Backup & report files from converting an old project file
177 | # to a newer Visual Studio version. Backup files are not needed,
178 | # because we have git ;-)
179 | _UpgradeReport_Files/
180 | Backup*/
181 | UpgradeLog*.XML
182 | UpgradeLog*.htm
183 |
184 | # SQL Server files
185 | *.mdf
186 | *.ldf
187 |
188 | # Business Intelligence projects
189 | *.rdl.data
190 | *.bim.layout
191 | *.bim_*.settings
192 |
193 | # Microsoft Fakes
194 | FakesAssemblies/
195 |
196 | # Node.js Tools for Visual Studio
197 | .ntvs_analysis.dat
198 |
199 | # Visual Studio 6 build log
200 | *.plg
201 |
202 | # Visual Studio 6 workspace options file
203 | *.opt
204 |
205 | **/node_modules
206 | **/node_modules/*
207 |
208 | # ASP.NET 5
209 | project.lock.json
210 | artifacts/
211 |
212 | #BenchmarkDotNet
213 | **/BenchmarkDotNet.Artifacts/
214 |
215 | # Build process
216 | *.csproj.bak
217 |
218 | #CodeCoverage
219 | *.lcov
220 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "shared-infrastructure"]
2 | path = shared-infrastructure
3 | url = https://github.com/SixLabors/SharedInfrastructure
4 |
--------------------------------------------------------------------------------
/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
14 |
15 | $(MSBuildThisFileDirectory)
16 |
17 |
18 |
19 |
20 |
21 |
35 |
36 |
37 |
38 |
39 | $(DefineConstants);SUPPORTS_SERIALIZATION
40 |
41 |
42 |
43 |
44 | $(DefineConstants);SUPPORTS_SERIALIZATION
45 |
46 |
47 |
48 |
49 | $(DefineConstants);SUPPORTS_SERIALIZATION
50 |
51 |
52 |
53 |
54 |
55 | $(DefineConstants);SUPPORTS_SERIALIZATION
56 | $(DefineConstants);SUPPORTS_CORE_CLR
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/Directory.Build.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright (c) Six Labors
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/NuGet.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/THIRD-PARTY-NOTICES.txt:
--------------------------------------------------------------------------------
1 | ZlibStream is built upon code that was originally distributed under a license different than the ZlibStream software.
2 |
3 | In the event that we accidentally failed to list a required notice, please bring it to our attention.
4 |
5 | The attached notices are provided for information only.
6 |
7 | License notice for ComponentAce
8 | -------------------------------
9 |
10 | Copyright (c) 2006, ComponentAce
11 | http://www.componentace.com
12 | All rights reserved.
13 |
14 | Redistribution and use in source and binary forms, with or without
15 | modification, are permitted provided that the following conditions are met:
16 |
17 | Redistributions of source code must retain the above copyright notice,
18 | this list of conditions and the following disclaimer.
19 |
20 | Redistributions in binary form must reproduce the above copyright
21 | notice, this list of conditions and the following disclaimer in
22 | the documentation and/or other materials provided with the distribution.
23 |
24 | Neither the name of ComponentAce nor the names of its contributors
25 | may be used to endorse or promote products derived from this
26 | software without specific prior written permission.
27 |
28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
33 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
36 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 |
41 | --------------------------------------------------------------------------------
42 |
43 | Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved.
44 |
45 | Redistribution and use in source and binary forms, with or without
46 | modification, are permitted provided that the following conditions are met:
47 |
48 | 1. Redistributions of source code must retain the above copyright notice,
49 | this list of conditions and the following disclaimer.
50 |
51 | 2. Redistributions in binary form must reproduce the above copyright
52 | notice, this list of conditions and the following disclaimer in
53 | the documentation and/or other materials provided with the distribution.
54 |
55 | 3. The names of the authors may not be used to endorse or promote products
56 | derived from this software without specific prior written permission.
57 |
58 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
59 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
60 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
61 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
62 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
63 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
64 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
65 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
66 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
67 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
68 |
69 | --------------------------------------------------------------------------------
70 |
71 | This program is based on zlib-1.1.3, so all credit should go authors
72 | Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)
73 | and contributors of zlib.
74 |
75 | License notice for Zlib
76 | -------------------------------
77 |
78 | Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
79 |
80 | This software is provided 'as-is', without any express or implied
81 | warranty. In no event will the authors be held liable for any damages
82 | arising from the use of this software.
83 |
84 | Permission is granted to anyone to use this software for any purpose,
85 | including commercial applications, and to alter it and redistribute it
86 | freely, subject to the following restrictions:
87 |
88 | 1. The origin of this software must not be misrepresented; you must not
89 | claim that you wrote the original software. If you use this software
90 | in a product, an acknowledgment in the product documentation would be
91 | appreciated but is not required.
92 | 2. Altered source versions must be plainly marked as such, and must not be
93 | misrepresented as being the original software.
94 | 3. This notice may not be removed or altered from any source distribution.
--------------------------------------------------------------------------------
/ZlibStream.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 12.00
2 | # Visual Studio Version 16
3 | VisualStudioVersion = 16.0.30011.22
4 | MinimumVisualStudioVersion = 10.0.40219.1
5 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZlibStream", "src\ZlibStream\ZlibStream.csproj", "{0C89B7A2-A218-49E4-B545-5B044A45F977}"
6 | EndProject
7 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{78670B24-8720-48FC-BD04-68C667B1C8CC}"
8 | ProjectSection(SolutionItems) = preProject
9 | src\Directory.Build.props = src\Directory.Build.props
10 | src\Directory.Build.targets = src\Directory.Build.targets
11 | EndProjectSection
12 | EndProject
13 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CB611663-07F2-4419-B83D-7AED9B406865}"
14 | ProjectSection(SolutionItems) = preProject
15 | tests\Directory.Build.props = tests\Directory.Build.props
16 | tests\Directory.Build.targets = tests\Directory.Build.targets
17 | EndProjectSection
18 | EndProject
19 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZlibStream.Tests", "tests\ZlibStream.Tests\ZlibStream.Tests.csproj", "{01E63166-CDBA-450F-A597-DE096B05A052}"
20 | EndProject
21 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZlibStream.Benchmarks", "tests\ZlibStream.Benchmarks\ZlibStream.Benchmarks.csproj", "{15FE1586-DED2-41F4-9292-6BE8787A60C4}"
22 | EndProject
23 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_root", "_root", "{F450D162-1FE5-4295-BDB8-8F78F6B51672}"
24 | ProjectSection(SolutionItems) = preProject
25 | ci-build.ps1 = ci-build.ps1
26 | ci-pack.ps1 = ci-pack.ps1
27 | ci-test.ps1 = ci-test.ps1
28 | Directory.Build.props = Directory.Build.props
29 | Directory.Build.targets = Directory.Build.targets
30 | LICENSE = LICENSE
31 | readme.md = readme.md
32 | EndProjectSection
33 | EndProject
34 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Corpus", "Corpus", "{7211DB62-F3C8-419C-846B-89949EBD1EAC}"
35 | ProjectSection(SolutionItems) = preProject
36 | tests\corpus\alice29.txt = tests\corpus\alice29.txt
37 | tests\corpus\asyoulik.txt = tests\corpus\asyoulik.txt
38 | tests\corpus\cp.html = tests\corpus\cp.html
39 | tests\corpus\fields.c = tests\corpus\fields.c
40 | tests\corpus\grammar.lsp = tests\corpus\grammar.lsp
41 | tests\corpus\kennedy.xls = tests\corpus\kennedy.xls
42 | tests\corpus\lcet10.txt = tests\corpus\lcet10.txt
43 | tests\corpus\plrabn12.txt = tests\corpus\plrabn12.txt
44 | tests\corpus\ptt5 = tests\corpus\ptt5
45 | tests\corpus\sum = tests\corpus\sum
46 | tests\corpus\xargs.1 = tests\corpus\xargs.1
47 | EndProjectSection
48 | EndProject
49 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{42C81331-D4CA-432D-95ED-92FB1A121267}"
50 | EndProject
51 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{AA25F9A0-775E-4184-8086-02BAE1C1F941}"
52 | ProjectSection(SolutionItems) = preProject
53 | .github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml
54 | .github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml
55 | EndProjectSection
56 | EndProject
57 | Global
58 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
59 | Debug|Any CPU = Debug|Any CPU
60 | Release|Any CPU = Release|Any CPU
61 | EndGlobalSection
62 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
63 | {0C89B7A2-A218-49E4-B545-5B044A45F977}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
64 | {0C89B7A2-A218-49E4-B545-5B044A45F977}.Debug|Any CPU.Build.0 = Debug|Any CPU
65 | {0C89B7A2-A218-49E4-B545-5B044A45F977}.Release|Any CPU.ActiveCfg = Release|Any CPU
66 | {0C89B7A2-A218-49E4-B545-5B044A45F977}.Release|Any CPU.Build.0 = Release|Any CPU
67 | {01E63166-CDBA-450F-A597-DE096B05A052}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
68 | {01E63166-CDBA-450F-A597-DE096B05A052}.Debug|Any CPU.Build.0 = Debug|Any CPU
69 | {01E63166-CDBA-450F-A597-DE096B05A052}.Release|Any CPU.ActiveCfg = Release|Any CPU
70 | {01E63166-CDBA-450F-A597-DE096B05A052}.Release|Any CPU.Build.0 = Release|Any CPU
71 | {15FE1586-DED2-41F4-9292-6BE8787A60C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
72 | {15FE1586-DED2-41F4-9292-6BE8787A60C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
73 | {15FE1586-DED2-41F4-9292-6BE8787A60C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
74 | {15FE1586-DED2-41F4-9292-6BE8787A60C4}.Release|Any CPU.Build.0 = Release|Any CPU
75 | EndGlobalSection
76 | GlobalSection(SolutionProperties) = preSolution
77 | HideSolutionNode = FALSE
78 | EndGlobalSection
79 | GlobalSection(NestedProjects) = preSolution
80 | {0C89B7A2-A218-49E4-B545-5B044A45F977} = {78670B24-8720-48FC-BD04-68C667B1C8CC}
81 | {01E63166-CDBA-450F-A597-DE096B05A052} = {CB611663-07F2-4419-B83D-7AED9B406865}
82 | {15FE1586-DED2-41F4-9292-6BE8787A60C4} = {CB611663-07F2-4419-B83D-7AED9B406865}
83 | {7211DB62-F3C8-419C-846B-89949EBD1EAC} = {CB611663-07F2-4419-B83D-7AED9B406865}
84 | {42C81331-D4CA-432D-95ED-92FB1A121267} = {F450D162-1FE5-4295-BDB8-8F78F6B51672}
85 | {AA25F9A0-775E-4184-8086-02BAE1C1F941} = {42C81331-D4CA-432D-95ED-92FB1A121267}
86 | EndGlobalSection
87 | GlobalSection(ExtensibilityGlobals) = postSolution
88 | SolutionGuid = {AE022F12-D088-439B-8AD2-EAAF2FE7C6C0}
89 | EndGlobalSection
90 | EndGlobal
91 |
--------------------------------------------------------------------------------
/ci-build.ps1:
--------------------------------------------------------------------------------
1 | param(
2 | [Parameter(Mandatory = $true, Position = 0)]
3 | [string]$targetFramework
4 | )
5 |
6 | dotnet clean -c Release
7 |
8 | $repositoryUrl = "https://github.com/$env:GITHUB_REPOSITORY"
9 |
10 | # Building for a specific framework.
11 | dotnet build -c Release -f $targetFramework /p:RepositoryUrl=$repositoryUrl
12 |
--------------------------------------------------------------------------------
/ci-pack.ps1:
--------------------------------------------------------------------------------
1 | dotnet clean -c Release
2 |
3 | $repositoryUrl = "https://github.com/$env:GITHUB_REPOSITORY"
4 |
5 | # Building for packing and publishing.
6 | dotnet pack -c Release --output "$PSScriptRoot/artifacts" /p:RepositoryUrl=$repositoryUrl
7 |
--------------------------------------------------------------------------------
/ci-test.ps1:
--------------------------------------------------------------------------------
1 | param(
2 | [Parameter(Mandatory, Position = 0)]
3 | [string]$os,
4 | [Parameter(Mandatory, Position = 1)]
5 | [string]$targetFramework,
6 | [Parameter(Mandatory, Position = 2)]
7 | [string]$platform,
8 | [Parameter(Mandatory, Position = 3)]
9 | [string]$codecov,
10 | [Parameter(Position = 4)]
11 | [string]$codecovProfile = 'Release'
12 | )
13 |
14 | $netFxRegex = '^net\d+'
15 |
16 | if ($codecov -eq 'true') {
17 |
18 | # Allow toggling of profile to workaround any potential JIT errors caused by code injection.
19 | dotnet clean -c $codecovProfile
20 | dotnet test --collect "XPlat Code Coverage" --settings .\tests\coverlet.runsettings -c $codecovProfile -f $targetFramework /p:CodeCov=true
21 | }
22 | elseif ($platform -eq '-x86' -and $targetFramework -match $netFxRegex) {
23 |
24 | # xunit doesn't run on core with NET SDK 3.1+.
25 | # xunit doesn't actually understand -x64 as an option.
26 | #
27 | # xunit requires explicit path.
28 | Set-Location $env:XUNIT_PATH
29 |
30 | dotnet xunit --no-build -c Release -f $targetFramework ${fxVersion} $platform
31 |
32 | Set-Location $PSScriptRoot
33 | }
34 | else {
35 |
36 | dotnet test --no-build -c Release -f $targetFramework
37 | }
38 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 |