Imported Upstream version 5.0.0.42

Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-04-10 11:41:01 +00:00
parent 1190d13a04
commit 6bdd276d05
19939 changed files with 3099680 additions and 93811 deletions

View File

@@ -0,0 +1,90 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.IO.Compression.Tests", "tests\System.IO.Compression.Tests.csproj", "{BC2E1649-291D-412E-9529-EDDA94FA7AD6}"
ProjectSection(ProjectDependencies) = postProject
{} = {}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.IO.Compression.Performance.Tests", "tests\Performance\System.IO.Compression.Performance.Tests.csproj", "{E1A709F3-F9C4-4223-AD9B-0A66C11D36C7}"
ProjectSection(ProjectDependencies) = postProject
{} = {}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.IO.Compression.Performance.Tests", "tests\Performance\System.IO.Compression.Performance.Tests.csproj", "{E1A709F3-F9C4-4223-AD9B-0A66C11D36C7}"
ProjectSection(ProjectDependencies) = postProject
{5471BFE8-8071-466F-838E-5ADAA779E742} = {5471BFE8-8071-466F-838E-5ADAA779E742}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.IO.Compression.Tests", "tests\System.IO.Compression.Tests.csproj", "{BC2E1649-291D-412E-9529-EDDA94FA7AD6}"
ProjectSection(ProjectDependencies) = postProject
{5471BFE8-8071-466F-838E-5ADAA779E742} = {5471BFE8-8071-466F-838E-5ADAA779E742}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.IO.Compression", "src\System.IO.Compression.csproj", "{5471BFE8-8071-466F-838E-5ADAA779E742}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F751C0F1-0318-404F-878B-0433E0AC0C45}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{116EBC44-8A06-494B-AC5E-F12599943A24}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{2576A66B-2AAF-4AE9-95CB-2528C33104E4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.IO.Compression", "ref\System.IO.Compression.csproj", "{ADF79DFD-4AC4-4A76-B472-93B86D3BD8E9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
DebugNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU = DebugNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU
ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU = ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU
DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU = DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU
ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU = ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU
DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU = DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU
ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU = ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E1A709F3-F9C4-4223-AD9B-0A66C11D36C7}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{E1A709F3-F9C4-4223-AD9B-0A66C11D36C7}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{E1A709F3-F9C4-4223-AD9B-0A66C11D36C7}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{E1A709F3-F9C4-4223-AD9B-0A66C11D36C7}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{E1A709F3-F9C4-4223-AD9B-0A66C11D36C7}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{E1A709F3-F9C4-4223-AD9B-0A66C11D36C7}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{E1A709F3-F9C4-4223-AD9B-0A66C11D36C7}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{E1A709F3-F9C4-4223-AD9B-0A66C11D36C7}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{E1A709F3-F9C4-4223-AD9B-0A66C11D36C7}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{E1A709F3-F9C4-4223-AD9B-0A66C11D36C7}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{E1A709F3-F9C4-4223-AD9B-0A66C11D36C7}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{E1A709F3-F9C4-4223-AD9B-0A66C11D36C7}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{BC2E1649-291D-412E-9529-EDDA94FA7AD6}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{BC2E1649-291D-412E-9529-EDDA94FA7AD6}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{BC2E1649-291D-412E-9529-EDDA94FA7AD6}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{BC2E1649-291D-412E-9529-EDDA94FA7AD6}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{BC2E1649-291D-412E-9529-EDDA94FA7AD6}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{BC2E1649-291D-412E-9529-EDDA94FA7AD6}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{BC2E1649-291D-412E-9529-EDDA94FA7AD6}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{BC2E1649-291D-412E-9529-EDDA94FA7AD6}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{BC2E1649-291D-412E-9529-EDDA94FA7AD6}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{BC2E1649-291D-412E-9529-EDDA94FA7AD6}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{BC2E1649-291D-412E-9529-EDDA94FA7AD6}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{BC2E1649-291D-412E-9529-EDDA94FA7AD6}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{5471BFE8-8071-466F-838E-5ADAA779E742}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Unix-Debug|Any CPU
{5471BFE8-8071-466F-838E-5ADAA779E742}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU.Build.0 = netcoreapp-Unix-Debug|Any CPU
{5471BFE8-8071-466F-838E-5ADAA779E742}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Unix-Release|Any CPU
{5471BFE8-8071-466F-838E-5ADAA779E742}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp|AnyCPU.Build.0 = netcoreapp-Unix-Release|Any CPU
{5471BFE8-8071-466F-838E-5ADAA779E742}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{5471BFE8-8071-466F-838E-5ADAA779E742}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{5471BFE8-8071-466F-838E-5ADAA779E742}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{5471BFE8-8071-466F-838E-5ADAA779E742}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{5471BFE8-8071-466F-838E-5ADAA779E742}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = net463-Windows_NT-Debug|Any CPU
{5471BFE8-8071-466F-838E-5ADAA779E742}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = net463-Windows_NT-Debug|Any CPU
{5471BFE8-8071-466F-838E-5ADAA779E742}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = net463-Windows_NT-Release|Any CPU
{5471BFE8-8071-466F-838E-5ADAA779E742}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = net463-Windows_NT-Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{BC2E1649-291D-412E-9529-EDDA94FA7AD6} = {BC2E1649-291D-412E-9529-EDDA94FA7AD6}
{5471BFE8-8071-466F-838E-5ADAA779E742} = {5471BFE8-8071-466F-838E-5ADAA779E742}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dir.props" />
<PropertyGroup>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<IsNETCoreApp>true</IsNETCoreApp>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<Project Include="System.IO.Compression.pkgproj" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
</Project>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<ProjectReference Include="..\ref\System.IO.Compression.csproj">
<SupportedFramework>netcoreapp2.0;net463;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.IO.Compression.builds" />
<InboxOnTargetFramework Include="net45">
<AsFrameworkReference>true</AsFrameworkReference>
</InboxOnTargetFramework>
<InboxOnTargetFramework Include="win8" />
<InboxOnTargetFramework Include="wpa81" />
<InboxOnTargetFramework Include="portable-net45+win8+wpa81" />
<InboxOnTargetFramework Include="MonoAndroid10">
<AsFrameworkReference>true</AsFrameworkReference>
</InboxOnTargetFramework>
<InboxOnTargetFramework Include="MonoTouch10">
<AsFrameworkReference>true</AsFrameworkReference>
</InboxOnTargetFramework>
<InboxOnTargetFramework Include="xamarinios10">
<AsFrameworkReference>true</AsFrameworkReference>
</InboxOnTargetFramework>
<InboxOnTargetFramework Include="xamarinmac20">
<AsFrameworkReference>true</AsFrameworkReference>
</InboxOnTargetFramework>
<InboxOnTargetFramework Include="xamarintvos10">
<AsFrameworkReference>true</AsFrameworkReference>
</InboxOnTargetFramework>
<InboxOnTargetFramework Include="xamarinwatchos10">
<AsFrameworkReference>true</AsFrameworkReference>
</InboxOnTargetFramework>
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>

View File

@@ -0,0 +1 @@
PermitHigherCompatibleImplementationVersion

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
netcoreapp;
uap;
</BuildConfigurations>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,105 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// ------------------------------------------------------------------------------
// Changes to this file must follow the http://aka.ms/api-review process.
// ------------------------------------------------------------------------------
namespace System.IO.Compression
{
public enum CompressionLevel
{
Fastest = 1,
NoCompression = 2,
Optimal = 0,
}
public enum CompressionMode
{
Compress = 1,
Decompress = 0,
}
public partial class DeflateStream : System.IO.Stream
{
public DeflateStream(System.IO.Stream stream, System.IO.Compression.CompressionLevel compressionLevel) { }
public DeflateStream(System.IO.Stream stream, System.IO.Compression.CompressionLevel compressionLevel, bool leaveOpen) { }
public DeflateStream(System.IO.Stream stream, System.IO.Compression.CompressionMode mode) { }
public DeflateStream(System.IO.Stream stream, System.IO.Compression.CompressionMode mode, bool leaveOpen) { }
public System.IO.Stream BaseStream { get { throw null; } }
public override bool CanRead { get { throw null; } }
public override bool CanSeek { get { throw null; } }
public override bool CanWrite { get { throw null; } }
public override long Length { get { throw null; } }
public override long Position { get { throw null; } set { } }
protected override void Dispose(bool disposing) { }
public override void Flush() { }
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState) { throw null; }
public override int EndRead(IAsyncResult asyncResult) { throw null; }
public override int Read(byte[] array, int offset, int count) { throw null; }
public override System.Threading.Tasks.Task<int> ReadAsync(byte[] array, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override long Seek(long offset, System.IO.SeekOrigin origin) { throw null; }
public override void SetLength(long value) { }
public override IAsyncResult BeginWrite(byte[] array, int offset, int count, AsyncCallback asyncCallback, object asyncState) { throw null; }
public override void EndWrite(IAsyncResult asyncResult) { }
public override void Write(byte[] array, int offset, int count) { }
public override System.Threading.Tasks.Task WriteAsync(byte[] array, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
}
public partial class GZipStream : System.IO.Stream
{
public GZipStream(System.IO.Stream stream, System.IO.Compression.CompressionLevel compressionLevel) { }
public GZipStream(System.IO.Stream stream, System.IO.Compression.CompressionLevel compressionLevel, bool leaveOpen) { }
public GZipStream(System.IO.Stream stream, System.IO.Compression.CompressionMode mode) { }
public GZipStream(System.IO.Stream stream, System.IO.Compression.CompressionMode mode, bool leaveOpen) { }
public System.IO.Stream BaseStream { get { throw null; } }
public override bool CanRead { get { throw null; } }
public override bool CanSeek { get { throw null; } }
public override bool CanWrite { get { throw null; } }
public override long Length { get { throw null; } }
public override long Position { get { throw null; } set { } }
protected override void Dispose(bool disposing) { }
public override void Flush() { }
public override IAsyncResult BeginRead(byte[] array, int offset, int count, AsyncCallback asyncCallback, object asyncState) { throw null; }
public override int EndRead(IAsyncResult asyncResult) { throw null; }
public override int Read(byte[] array, int offset, int count) { throw null; }
public override System.Threading.Tasks.Task<int> ReadAsync(byte[] array, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override long Seek(long offset, System.IO.SeekOrigin origin) { throw null; }
public override void SetLength(long value) { }
public override IAsyncResult BeginWrite(byte[] array, int offset, int count, AsyncCallback asyncCallback, object asyncState) { throw null; }
public override void EndWrite(IAsyncResult asyncResult) { }
public override void Write(byte[] array, int offset, int count) { }
public override System.Threading.Tasks.Task WriteAsync(byte[] array, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
}
public partial class ZipArchive : System.IDisposable
{
public ZipArchive(System.IO.Stream stream) { }
public ZipArchive(System.IO.Stream stream, System.IO.Compression.ZipArchiveMode mode) { }
public ZipArchive(System.IO.Stream stream, System.IO.Compression.ZipArchiveMode mode, bool leaveOpen) { }
public ZipArchive(System.IO.Stream stream, System.IO.Compression.ZipArchiveMode mode, bool leaveOpen, System.Text.Encoding entryNameEncoding) { }
public System.Collections.ObjectModel.ReadOnlyCollection<System.IO.Compression.ZipArchiveEntry> Entries { get { throw null; } }
public System.IO.Compression.ZipArchiveMode Mode { get { throw null; } }
public System.IO.Compression.ZipArchiveEntry CreateEntry(string entryName) { throw null; }
public System.IO.Compression.ZipArchiveEntry CreateEntry(string entryName, System.IO.Compression.CompressionLevel compressionLevel) { throw null; }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public System.IO.Compression.ZipArchiveEntry GetEntry(string entryName) { throw null; }
}
public partial class ZipArchiveEntry
{
internal ZipArchiveEntry() { }
public System.IO.Compression.ZipArchive Archive { get { throw null; } }
public long CompressedLength { get { throw null; } }
public string FullName { get { throw null; } }
public System.DateTimeOffset LastWriteTime { get { throw null; } set { } }
public long Length { get { throw null; } }
public string Name { get { throw null; } }
public void Delete() { }
public System.IO.Stream Open() { throw null; }
public override string ToString() { throw null; }
}
public enum ZipArchiveMode
{
Create = 1,
Read = 0,
Update = 2,
}
}

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<UseECMAKey>true</UseECMAKey>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="System.IO.Compression.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.IO\ref\System.IO.csproj" />
<ProjectReference Include="..\..\System.Text.Encoding\ref\System.Text.Encoding.csproj" />
<ProjectReference Include="..\..\System.Threading.Tasks\ref\System.Threading.Tasks.csproj" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>

View File

@@ -0,0 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Security;
[assembly: SecurityTransparentAttribute()]

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
netcoreapp-Unix;
netcoreapp-Windows_NT;
net463-Windows_NT;
</BuildConfigurations>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,45 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.IO.Compression;
using System.Runtime.InteropServices;
internal static partial class Interop
{
internal static partial class zlib
{
[DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateInit2_")]
internal static extern ZLibNative.ErrorCode DeflateInit2_(
ref ZLibNative.ZStream stream,
ZLibNative.CompressionLevel level,
ZLibNative.CompressionMethod method,
int windowBits,
int memLevel,
ZLibNative.CompressionStrategy strategy);
[DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Deflate")]
internal static extern ZLibNative.ErrorCode Deflate(ref ZLibNative.ZStream stream, ZLibNative.FlushCode flush);
[DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateEnd")]
internal static extern ZLibNative.ErrorCode DeflateEnd(ref ZLibNative.ZStream stream);
[DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateInit2_")]
internal static extern ZLibNative.ErrorCode InflateInit2_(ref ZLibNative.ZStream stream, int windowBits);
[DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Inflate")]
internal static extern ZLibNative.ErrorCode Inflate(ref ZLibNative.ZStream stream, ZLibNative.FlushCode flush);
[DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateEnd")]
internal static extern ZLibNative.ErrorCode InflateEnd(ref ZLibNative.ZStream stream);
internal static unsafe uint crc32(uint crc, byte[] buffer, int offset, int len)
{
fixed (byte* buf = &buffer[offset])
return Crc32(crc, buf, len);
}
[DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Crc32")]
private static extern unsafe uint Crc32(uint crc, byte* buffer, int len);
}
}

View File

@@ -0,0 +1,106 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.IO.Compression;
using System.Runtime.InteropServices;
internal static partial class Interop
{
internal static partial class zlib
{
private static readonly byte[] ZLibVersion = { (byte)'1', (byte)'.', (byte)'2', (byte)'.', (byte)'3', 0 };
[DllImport(Libraries.Zlib)]
private extern static unsafe int deflateInit2_(byte* stream, int level, int method, int windowBits, int memLevel, int strategy,
byte* version, int stream_size);
[DllImport(Libraries.Zlib)]
private extern static unsafe int deflate(byte* stream, int flush);
[DllImport(Libraries.Zlib)]
private extern static unsafe int deflateEnd(byte* strm);
[DllImport(Libraries.Zlib)]
internal extern static unsafe uint crc32(uint crc, byte* buffer, int len);
[DllImport(Libraries.Zlib)]
private extern static unsafe int inflateInit2_(byte* stream, int windowBits, byte* version, int stream_size);
[DllImport(Libraries.Zlib)]
private extern static unsafe int inflate(byte* stream, int flush);
[DllImport(Libraries.Zlib)]
private extern static unsafe int inflateEnd(byte* stream);
internal static unsafe ZLibNative.ErrorCode DeflateInit2_(
ref ZLibNative.ZStream stream,
ZLibNative.CompressionLevel level,
ZLibNative.CompressionMethod method,
int windowBits,
int memLevel,
ZLibNative.CompressionStrategy strategy)
{
fixed (byte* versionString = ZLibVersion)
fixed (ZLibNative.ZStream* streamBytes = &stream)
{
byte* pBytes = (byte*)streamBytes;
return (ZLibNative.ErrorCode)deflateInit2_(pBytes, (int)level, (int)method, (int)windowBits, (int)memLevel, (int)strategy, versionString, sizeof(ZLibNative.ZStream));
}
}
internal static unsafe uint crc32(uint crc, byte[] buffer, int offset, int len)
{
fixed (byte* buf = &buffer[offset])
return crc32(crc, buf, len);
}
internal static unsafe ZLibNative.ErrorCode Deflate(ref ZLibNative.ZStream stream, ZLibNative.FlushCode flush)
{
fixed (ZLibNative.ZStream* streamBytes = &stream)
{
byte* pBytes = (byte*)streamBytes;
return (ZLibNative.ErrorCode)deflate(pBytes, (int)flush);
}
}
internal static unsafe ZLibNative.ErrorCode DeflateEnd(ref ZLibNative.ZStream stream)
{
fixed (ZLibNative.ZStream* streamBytes = &stream)
{
byte* pBytes = (byte*)streamBytes;
return (ZLibNative.ErrorCode)deflateEnd(pBytes);
}
}
internal static unsafe ZLibNative.ErrorCode InflateInit2_(
ref ZLibNative.ZStream stream,
int windowBits)
{
fixed (byte* versionString = ZLibVersion)
fixed (ZLibNative.ZStream* streamBytes = &stream)
{
byte* pBytes = (byte*)streamBytes;
return (ZLibNative.ErrorCode)inflateInit2_(pBytes, (int)windowBits, versionString, sizeof(ZLibNative.ZStream));
}
}
internal static unsafe ZLibNative.ErrorCode Inflate(ref ZLibNative.ZStream stream, ZLibNative.FlushCode flush)
{
fixed (ZLibNative.ZStream* streamBytes = &stream)
{
byte* pBytes = (byte*)streamBytes;
return (ZLibNative.ErrorCode)inflate(pBytes, (int)flush);
}
}
internal static unsafe ZLibNative.ErrorCode InflateEnd(ref ZLibNative.ZStream stream)
{
fixed (ZLibNative.ZStream* streamBytes = &stream)
{
byte* pBytes = (byte*)streamBytes;
return (ZLibNative.ErrorCode)inflateEnd(pBytes);
}
}
}
}

View File

@@ -0,0 +1,8 @@
<!-- Not a bug. clrcompression.dll is a native component that ships as part of the package. -->
clrcompression.dll!inflate
clrcompression.dll!deflate
clrcompression.dll!inflateEnd
clrcompression.dll!deflateEnd
clrcompression.dll!crc32
clrcompression.dll!inflateInit2_
clrcompression.dll!deflateInit2_

View File

@@ -0,0 +1,330 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ArgumentOutOfRange_Enum" xml:space="preserve">
<value>Enum value was out of legal range.</value>
</data>
<data name="ArgumentOutOfRange_NeedPosNum" xml:space="preserve">
<value>Positive number required.</value>
</data>
<data name="CannotReadFromDeflateStream" xml:space="preserve">
<value>Reading from the compression stream is not supported.</value>
</data>
<data name="CannotWriteToDeflateStream" xml:space="preserve">
<value>Writing to the compression stream is not supported.</value>
</data>
<data name="GenericInvalidData" xml:space="preserve">
<value>Found invalid data while decoding.</value>
</data>
<data name="InvalidArgumentOffsetCount" xml:space="preserve">
<value>Offset plus count is larger than the length of target array.</value>
</data>
<data name="InvalidBeginCall" xml:space="preserve">
<value>Only one asynchronous reader or writer is allowed time at one time.</value>
</data>
<data name="InvalidBlockLength" xml:space="preserve">
<value>Block length does not match with its complement.</value>
</data>
<data name="InvalidHuffmanData" xml:space="preserve">
<value>Failed to construct a huffman tree using the length array. The stream might be corrupted.</value>
</data>
<data name="NotSupported" xml:space="preserve">
<value>This operation is not supported.</value>
</data>
<data name="NotSupported_UnreadableStream" xml:space="preserve">
<value>Stream does not support reading.</value>
</data>
<data name="NotSupported_UnwritableStream" xml:space="preserve">
<value>Stream does not support writing.</value>
</data>
<data name="ObjectDisposed_StreamClosed" xml:space="preserve">
<value>Can not access a closed Stream.</value>
</data>
<data name="UnknownBlockType" xml:space="preserve">
<value>Unknown block type. Stream might be corrupted.</value>
</data>
<data name="UnknownState" xml:space="preserve">
<value>Decoder is in some unknown state. This might be caused by corrupted data.</value>
</data>
<data name="ZLibErrorDLLLoadError" xml:space="preserve">
<value>The underlying compression routine could not be loaded correctly.</value>
</data>
<data name="ZLibErrorInconsistentStream" xml:space="preserve">
<value>The stream state of the underlying compression routine is inconsistent.</value>
</data>
<data name="ZLibErrorIncorrectInitParameters" xml:space="preserve">
<value>The underlying compression routine received incorrect initialization parameters.</value>
</data>
<data name="ZLibErrorNotEnoughMemory" xml:space="preserve">
<value>The underlying compression routine could not reserve sufficient memory.</value>
</data>
<data name="ZLibErrorVersionMismatch" xml:space="preserve">
<value>The version of the underlying compression routine does not match expected version.</value>
</data>
<data name="ZLibErrorUnexpected" xml:space="preserve">
<value>The underlying compression routine returned an unexpected error code.</value>
</data>
<data name="CorruptedGZipHeader" xml:space="preserve">
<value>The magic number in GZip header is not correct. Make sure you are passing in a GZip stream.</value>
</data>
<data name="UnknownCompressionMode" xml:space="preserve">
<value>The compression mode specified in GZip header is unknown.</value>
</data>
<data name="InvalidCRC" xml:space="preserve">
<value>The CRC in GZip footer does not match the CRC calculated from the decompressed data.</value>
</data>
<data name="InvalidStreamSize" xml:space="preserve">
<value>The stream size in GZip footer does not match the real stream size.</value>
</data>
<data name="ArgumentNeedNonNegative" xml:space="preserve">
<value>The argument must be non-negative.</value>
</data>
<data name="CannotBeEmpty" xml:space="preserve">
<value>String cannot be empty.</value>
</data>
<data name="CDCorrupt" xml:space="preserve">
<value>Central Directory corrupt.</value>
</data>
<data name="CentralDirectoryInvalid" xml:space="preserve">
<value>Central Directory is invalid.</value>
</data>
<data name="CreateInReadMode" xml:space="preserve">
<value>Cannot create entries on an archive opened in read mode.</value>
</data>
<data name="CreateModeCapabilities" xml:space="preserve">
<value>Cannot use create mode on a non-writable stream.</value>
</data>
<data name="CreateModeCreateEntryWhileOpen" xml:space="preserve">
<value>Entries cannot be created while previously created entries are still open.</value>
</data>
<data name="CreateModeWriteOnceAndOneEntryAtATime" xml:space="preserve">
<value>Entries in create mode may only be written to once, and only one entry may be held open at a time.</value>
</data>
<data name="DateTimeOutOfRange" xml:space="preserve">
<value>The DateTimeOffset specified cannot be converted into a Zip file timestamp.</value>
</data>
<data name="DeletedEntry" xml:space="preserve">
<value>Cannot modify deleted entry.</value>
</data>
<data name="DeleteOnlyInUpdate" xml:space="preserve">
<value>Delete can only be used when the archive is in Update mode.</value>
</data>
<data name="DeleteOpenEntry" xml:space="preserve">
<value>Cannot delete an entry currently open for writing.</value>
</data>
<data name="EntriesInCreateMode" xml:space="preserve">
<value>Cannot access entries in Create mode.</value>
</data>
<data name="EntryNameEncodingNotSupported" xml:space="preserve">
<value>The specified entry name encoding is not supported.</value>
</data>
<data name="EntryNamesTooLong" xml:space="preserve">
<value>Entry names cannot require more than 2^16 bits.</value>
</data>
<data name="EntryTooLarge" xml:space="preserve">
<value>Entries larger than 4GB are not supported in Update mode.</value>
</data>
<data name="EOCDNotFound" xml:space="preserve">
<value>End of Central Directory record could not be found.</value>
</data>
<data name="FieldTooBigCompressedSize" xml:space="preserve">
<value>Compressed Size cannot be held in an Int64.</value>
</data>
<data name="FieldTooBigLocalHeaderOffset" xml:space="preserve">
<value>Local Header Offset cannot be held in an Int64.</value>
</data>
<data name="FieldTooBigNumEntries" xml:space="preserve">
<value>Number of Entries cannot be held in an Int64.</value>
</data>
<data name="FieldTooBigOffsetToCD" xml:space="preserve">
<value>Offset to Central Directory cannot be held in an Int64.</value>
</data>
<data name="FieldTooBigOffsetToZip64EOCD" xml:space="preserve">
<value>Offset to Zip64 End Of Central Directory record cannot be held in an Int64.</value>
</data>
<data name="FieldTooBigStartDiskNumber" xml:space="preserve">
<value>Start Disk Number cannot be held in an Int64.</value>
</data>
<data name="FieldTooBigUncompressedSize" xml:space="preserve">
<value>Uncompressed Size cannot be held in an Int64.</value>
</data>
<data name="FrozenAfterWrite" xml:space="preserve">
<value>Cannot modify entry in Create mode after entry has been opened for writing.</value>
</data>
<data name="HiddenStreamName" xml:space="preserve">
<value>A stream from ZipArchiveEntry has been disposed.</value>
</data>
<data name="LengthAfterWrite" xml:space="preserve">
<value>Length properties are unavailable once an entry has been opened for writing.</value>
</data>
<data name="LocalFileHeaderCorrupt" xml:space="preserve">
<value>A local file header is corrupt.</value>
</data>
<data name="NumEntriesWrong" xml:space="preserve">
<value>Number of entries expected in End Of Central Directory does not correspond to number of entries in Central Directory.</value>
</data>
<data name="OffsetLengthInvalid" xml:space="preserve">
<value>The offset and length parameters are not valid for the array that was given.</value>
</data>
<data name="ReadingNotSupported" xml:space="preserve">
<value>This stream from ZipArchiveEntry does not support reading.</value>
</data>
<data name="ReadModeCapabilities" xml:space="preserve">
<value>Cannot use read mode on a non-readable stream.</value>
</data>
<data name="ReadOnlyArchive" xml:space="preserve">
<value>Cannot modify read-only archive.</value>
</data>
<data name="SeekingNotSupported" xml:space="preserve">
<value>This stream from ZipArchiveEntry does not support seeking.</value>
</data>
<data name="SetLengthRequiresSeekingAndWriting" xml:space="preserve">
<value>SetLength requires a stream that supports seeking and writing.</value>
</data>
<data name="SplitSpanned" xml:space="preserve">
<value>Split or spanned archives are not supported.</value>
</data>
<data name="UnexpectedEndOfStream" xml:space="preserve">
<value>Zip file corrupt: unexpected end of stream reached.</value>
</data>
<data name="UnsupportedCompression" xml:space="preserve">
<value>The archive entry was compressed using an unsupported compression method.</value>
</data>
<data name="UnsupportedCompressionMethod" xml:space="preserve">
<value>The archive entry was compressed using {0} and is not supported.</value>
</data>
<data name="UpdateModeCapabilities" xml:space="preserve">
<value>Update mode requires a stream with read, write, and seek capabilities.</value>
</data>
<data name="UpdateModeOneStream" xml:space="preserve">
<value>Entries cannot be opened multiple times in Update mode.</value>
</data>
<data name="WritingNotSupported" xml:space="preserve">
<value>This stream from ZipArchiveEntry does not support writing.</value>
</data>
<data name="Zip64EOCDNotWhereExpected" xml:space="preserve">
<value>Zip 64 End of Central Directory Record not where indicated.</value>
</data>
<data name="Argument_InvalidPathChars" xml:space="preserve">
<value>Illegal characters in path.</value>
</data>
<data name="FileNameContainsInvalidCharacters" xml:space="preserve">
<value>An entry in the ZipArchive has a path that contains invalid characters.</value>
</data>
</root>

View File

@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<AssemblyName>System.IO.Compression</AssemblyName>
<OutputType>Library</OutputType>
<ProjectGuid>{5471BFE8-8071-466F-838E-5ADAA779E742}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<UseECMAKey>true</UseECMAKey>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)' == 'net46'">true</IsPartialFacadeAssembly>
</PropertyGroup>
<!-- Default configurations to help VS understand the options -->
<!-- Files shared between net46 and core -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net463-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net463-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="$(SharedOpenSourcePath)System\IO\Compression\Crc32Helper.cs" />
<Compile Include="$(SharedOpenSourcePath)System\IO\Compression\ZipArchive.cs" />
<Compile Include="$(SharedOpenSourcePath)System\IO\Compression\ZipArchiveEntry.cs" />
<Compile Include="$(SharedOpenSourcePath)System\IO\Compression\ZipArchiveMode.cs" />
<Compile Include="$(SharedOpenSourcePath)System\IO\Compression\ZipBlocks.cs" />
<Compile Include="$(SharedOpenSourcePath)System\IO\Compression\ZipCustomStreams.cs" />
<Compile Include="$(SharedOpenSourcePath)System\IO\Compression\ZipHelper.cs" />
<Compile Include="$(SharedOpenSourcePath)System\IO\Compression\ZipVersion.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\BlockType.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\CopyEncoder.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\DeflateInput.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\DeflaterManaged.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\DeflateManagedStream.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\FastEncoder.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\FastEncoderStatus.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\FastEncoderWindow.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\FileFormats.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\HuffmanTree.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\InflaterManaged.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\InflaterState.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\InputBuffer.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\Match.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\MatchState.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\OutputBuffer.cs" />
<Compile Include="System\IO\Compression\DeflateManaged\OutputWindow.cs" />
<Compile Include="$(CommonPath)\System\IO\PathInternal.cs">
<Link>Common\System\IO\PathInternal.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\System\Threading\Tasks\TaskToApm.cs">
<Link>Common\System\Threading\Tasks\TaskToApm.cs</Link>
</Compile>
<Compile Include="System\IO\Compression\PositionPreservingWriteOnlyStreamWrapper.cs" />
</ItemGroup>
<!-- Files exclusive to Core -->
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp'">
<Compile Include="System\IO\Compression\CompressionLevel.cs" />
<Compile Include="System\IO\Compression\CompressionMode.cs" />
<Compile Include="System\IO\Compression\GZipStream.cs" />
<Compile Include="System\IO\Compression\DeflateZLib\Deflater.cs" />
<Compile Include="System\IO\Compression\DeflateZLib\DeflateStream.cs" />
<Compile Include="System\IO\Compression\DeflateZLib\Inflater.cs" />
<Compile Include="System\IO\Compression\DeflateZLib\ZLibException.cs" />
<Compile Include="System\IO\Compression\DeflateZLib\ZLibNative.cs" />
<Compile Include="$(CommonPath)\System\IO\StreamHelpers.CopyValidation.cs">
<Link>Common\System\IO\StreamHelpers.CopyValidation.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp' ">
<Compile Include="System\IO\Compression\ZLibException.Serialization.cs" />
</ItemGroup>
<!-- Windows specific files common to both net46 and Core -->
<ItemGroup Condition=" '$(TargetsWindows)' == 'true'">
<Compile Include="System\IO\Compression\ZipArchiveEntry.Windows.cs" />
<Compile Include="$(CommonPath)\System\IO\PathInternal.Windows.cs">
<Link>Common\System\IO\PathInternal.Windows.cs</Link>
</Compile>
</ItemGroup>
<!-- Windows specific files exclusive to Core -->
<ItemGroup Condition=" '$(TargetsWindows)' == 'true' And '$(TargetGroup)' == 'netcoreapp'">
<Compile Include="System\IO\Compression\DeflateZLib\ZLibNative.Windows.cs" />
<Compile Include="Interop\Interop.zlib.Windows.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\Interop.Libraries.cs">
<Link>Common\Interop\Windows\Interop.Libraries.cs</Link>
</Compile>
</ItemGroup>
<!-- Unix specific files -->
<ItemGroup Condition=" '$(TargetsUnix)' == 'true' ">
<Compile Include="System\IO\Compression\DeflateZLib\ZLibNative.Unix.cs" />
<Compile Include="System\IO\Compression\ZipArchiveEntry.Unix.cs" />
<Compile Include="Interop\Interop.zlib.Unix.cs" />
<Compile Include="$(CommonPath)\Interop\Unix\Interop.Libraries.cs">
<Link>Common\Interop\Unix\Interop.Libraries.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\System\IO\PathInternal.Unix.cs">
<Link>Common\System\IO\PathInternal.Unix.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\Interop\Unix\System.Native\Interop.PathConf.cs">
<Link>Common\Interop\Unix\System.Native\Interop.PathConf.cs</Link>
</Compile>
</ItemGroup>
<!-- Files exclusive to net46 -->
<ItemGroup Condition="'$(TargetGroup)' == 'net46'">
<Compile Include="AssemblyInfo.cs" />
<TargetingPackReference Include="mscorlib" />
<TargetingPackReference Include="System" />
<TargetingPackReference Include="System.Runtime" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Buffers" />
<Reference Include="System.Collections" />
<Reference Include="System.Diagnostics.Contracts" />
<Reference Include="System.Diagnostics.Debug" />
<Reference Include="System.Diagnostics.Tools" />
<Reference Include="System.Resources.ResourceManager" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Threading" />
<Reference Include="System.Threading.Tasks" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>

View File

@@ -0,0 +1,19 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace System.IO.Compression
{
/// <summary>
/// Defines a tradeoff between fast vs. strong compression. The specific meaning depends of the Deflater implementation.
/// </summary>
// This is an abstract concept and NOT the ZLib compression level.
// There may or may not be any correspondence with the a possible implementation-specific level-parameter of the deflater.
public enum CompressionLevel
{
Optimal = 0,
Fastest = 1,
NoCompression = 2
}
}

View File

@@ -0,0 +1,12 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace System.IO.Compression
{
public enum CompressionMode
{
Decompress = 0,
Compress = 1
}
}

View File

@@ -0,0 +1,39 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// File implements Slicing-by-8 CRC Generation, as described in
// "Novel Table Lookup-Based Algorithms for High-Performance CRC Generation"
// IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 11, NOVEMBER 2008
/*
* Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved
*
*
* This software program is licensed subject to the BSD License,
* available at http://www.opensource.org/licenses/bsd-license.html.
*/
using System.Diagnostics;
namespace System.IO.Compression
{
/// <summary>
/// This class contains a managed Crc32 function as well as an indirection to the Interop.Zlib.Crc32 call.
/// Since Desktop compression uses this file alongside the Open ZipArchive, we cannot remove it
/// without breaking the Desktop build.
///
/// Note that in CoreFX the ZlibCrc32 function is always called.
/// </summary>
internal static class Crc32Helper
{
// Calculate CRC based on the old CRC and the new bytes
// See RFC1952 for details.
public static uint UpdateCrc32(uint crc32, byte[] buffer, int offset, int length)
{
Debug.Assert((buffer != null) && (offset >= 0) && (length >= 0)
&& (offset <= buffer.Length - length), "check the caller");
return Interop.zlib.crc32(crc32, buffer, offset, length);
}
}
}

View File

@@ -0,0 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace System.IO.Compression
{
internal enum BlockType
{
Uncompressed = 0,
Static = 1,
Dynamic = 2
}
}

View File

@@ -0,0 +1,81 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
namespace System.IO.Compression
{
internal sealed class CopyEncoder
{
/// <summary>
/// padding for copy encoder formatting
/// - 1 byte for header
/// - 4 bytes for len, nlen
/// </summary>
private const int PaddingSize = 5;
private const int MaxUncompressedBlockSize = 65536;
/// <summary>
/// null input means write an empty payload with formatting info. This is needed for the final block.
/// </summary>
public void GetBlock(DeflateInput input, OutputBuffer output, bool isFinal)
{
Debug.Assert(output != null);
Debug.Assert(output.FreeBytes >= PaddingSize);
// determine number of bytes to write
int count = 0;
if (input != null)
{
// allow space for padding and bits not yet flushed to buffer
count = Math.Min(input.Count, output.FreeBytes - PaddingSize - output.BitsInBuffer);
// we don't expect the output buffer to ever be this big (currently 4K), but we'll check this
// just in case that changes.
if (count > MaxUncompressedBlockSize - PaddingSize)
{
count = MaxUncompressedBlockSize - PaddingSize;
}
}
// write header and flush bits
if (isFinal)
{
output.WriteBits(
FastEncoderStatics.BFinalNoCompressionHeaderBitCount,
FastEncoderStatics.BFinalNoCompressionHeader);
}
else
{
output.WriteBits(
FastEncoderStatics.NoCompressionHeaderBitCount,
FastEncoderStatics.NoCompressionHeader);
}
// now we're aligned
output.FlushBits();
// write len, nlen
WriteLenNLen((ushort)count, output);
// write uncompressed bytes
if (input != null && count > 0)
{
output.WriteBytes(input.Buffer, input.StartIndex, count);
input.ConsumeBytes(count);
}
}
private void WriteLenNLen(ushort len, OutputBuffer output)
{
// len
output.WriteUInt16(len);
// nlen
ushort onesComp = (ushort)(~(ushort)len);
output.WriteUInt16(onesComp);
}
}
}

Some files were not shown because too many files have changed in this diff Show More