Skip to content
This repository was archived by the owner on Jan 5, 2021. It is now read-only.

Commit fcd51f5

Browse files
interactive read, mono compatibility
1 parent 24ac25b commit fcd51f5

40 files changed

+336
-67
lines changed

CHANGES.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.0.10.93
2+
- BUGFIX: support for Mono (with full .NET 4 assembly, not only Portable)
3+
- ISSUE: added InteractiveRead mode (useful with network streams)
4+
- DEPRECATED: some LZ4Stream constructors are now depreacated, please use new ones instead
5+
16
## 1.0.9.93
27
- ADDED: support for .NET 2
38
- ADDED: support for Windows Phone

src/LZ4.Tests.Helpers/Properties/AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
3535
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.9.93")]
36+
[assembly: AssemblyFileVersion("1.0.10.93")]

src/LZ4.Tests/Properties/AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
// by using the '*' as shown below:
2424
// [assembly: AssemblyVersion("1.0.*")]
2525
[assembly: AssemblyVersion("1.0.0.0")]
26-
[assembly: AssemblyFileVersion("1.0.9.93")]
26+
[assembly: AssemblyFileVersion("1.0.10.93")]

src/LZ4.Tests/StreamTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void CopyTo()
3636
}
3737

3838
using (var istream = File.OpenRead(tempFileName))
39-
using (var zstream = new LZ4Stream(istream, CompressionMode.Decompress))
39+
using (var zstream = new LZ4Stream(istream, CompressionMode.Decompress, LZ4StreamFlags.InteractiveRead))
4040
using (var ostream = File.Create(tempFileName + ".orig"))
4141
{
4242
zstream.CopyTo(ostream);
@@ -91,7 +91,7 @@ public void TcpClient(int port)
9191
Console.WriteLine("Connected...");
9292

9393
using (var tcpStream = client.GetStream())
94-
using (var lz4Stream = new LZ4Stream(tcpStream, CompressionMode.Decompress))
94+
using (var lz4Stream = new LZ4Stream(tcpStream, CompressionMode.Decompress, LZ4StreamFlags.InteractiveRead))
9595
using (var reader = new BinaryReader(lz4Stream))
9696
{
9797
while (true)

src/LZ4.net2/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
// You can specify all the values or you can default the Build and Revision Numbers
2525
// by using the '*' as shown below:
2626
// [assembly: AssemblyVersion("1.0.*")]
27-
[assembly: AssemblyVersion("1.0.9.93")]
28-
[assembly: AssemblyFileVersion("1.0.9.93")]
27+
[assembly: AssemblyVersion("1.0.10.93")]
28+
[assembly: AssemblyFileVersion("1.0.10.93")]

src/LZ4.portable/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
// You can specify all the values or you can default the Build and Revision Numbers
2525
// by using the '*' as shown below:
2626
// [assembly: AssemblyVersion("1.0.*")]
27-
[assembly: AssemblyVersion("1.0.9.93")]
28-
[assembly: AssemblyFileVersion("1.0.9.93")]
27+
[assembly: AssemblyVersion("1.0.10.93")]
28+
[assembly: AssemblyFileVersion("1.0.10.93")]

src/LZ4.silverlight/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
// You can specify all the values or you can default the Build and Revision Numbers
2525
// by using the '*' as shown below:
2626
// [assembly: AssemblyVersion("1.0.*")]
27-
[assembly: AssemblyVersion("1.0.9.93")]
28-
[assembly: AssemblyFileVersion("1.0.9.93")]
27+
[assembly: AssemblyVersion("1.0.10.93")]
28+
[assembly: AssemblyFileVersion("1.0.10.93")]

src/LZ4.sln

+72-3
Large diffs are not rendered by default.

src/LZ4/LZ4Codec.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ private static T Try<T>(Func<T> method, T defaultValue)
272272

273273
/// <summary>Tries to create a specified <seealso cref="ILZ4Service" /> and tests it.</summary>
274274
/// <typeparam name="T">Concrete <seealso cref="ILZ4Service" /> type.</typeparam>
275-
/// <returns>A service if suceeded or <c>null</c> if it failed.</returns>
275+
/// <returns>A service if succeeded or <c>null</c> if it failed.</returns>
276276
[MethodImpl(MethodImplOptions.NoInlining)]
277277
private static ILZ4Service TryService<T>()
278278
where T: ILZ4Service, new()
@@ -281,8 +281,9 @@ private static ILZ4Service TryService<T>()
281281
{
282282
return AutoTest(new T());
283283
}
284-
catch
284+
catch (Exception)
285285
{
286+
// I could use Trace here but portable profile does not have Trace
286287
return null;
287288
}
288289
}

src/LZ4/LZ4Stream.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public LZ4Stream(
133133
_innerStream = innerStream;
134134
_compressionMode = compressionMode;
135135
_highCompression = (compressionFlags & LZ4StreamFlags.HighCompression) != 0;
136-
_interactiveRead = (compressionFlags & LZ4StreamFlags.FullBlockRead) == 0;
136+
_interactiveRead = (compressionFlags & LZ4StreamFlags.InteractiveRead) != 0;
137137
_isolateInnerStream = (compressionFlags & LZ4StreamFlags.IsolateInnerStream) != 0;
138138
_blockSize = Math.Max(16, blockSize);
139139
}

src/LZ4/LZ4Stream.windows.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public partial class LZ4Stream
4040
/// <param name="blockSize">Size of the block.</param>
4141
/// <param name="interactiveRead">if set to <c>true</c> interactive read mode is used.
4242
/// It means that <see cref="Read"/> method tries to return data as soon as possible.
43-
/// Please note, that this should be default behaviour but has been made optional for
43+
/// Please note, that this should be default behavior but has been made optional for
4444
/// backward compatibility. This constructor will be changed in next major release.</param>
4545
[Obsolete("This constructor is obsolete")]
4646
public LZ4Stream(
@@ -103,8 +103,8 @@ private static LZ4StreamFlags CombineLZ4Flags(
103103
var result = LZ4StreamFlags.Default;
104104
if (highCompression)
105105
result |= LZ4StreamFlags.HighCompression;
106-
if (!interactiveRead)
107-
result |= LZ4StreamFlags.FullBlockRead;
106+
if (interactiveRead)
107+
result |= LZ4StreamFlags.InteractiveRead;
108108
return result;
109109
}
110110

src/LZ4/LZ4StreamFlags.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ namespace LZ4
88
[Flags]
99
public enum LZ4StreamFlags
1010
{
11-
/// <summary>Empty settings. No special behaviour.</summary>
11+
/// <summary>Empty settings. No special behavior.</summary>
1212
None = 0x00,
1313

14-
/// <summary>Enforces full block reads.</summary>
15-
FullBlockRead = 0x01,
14+
/// <summary>Allows to use interactive mode, possibly returning partial blocks.</summary>
15+
InteractiveRead = 0x01,
1616

1717
/// <summary>Uses high compression version of algorithm.</summary>
1818
HighCompression = 0x02,

src/LZ4/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.6.93")]
34-
[assembly: AssemblyVersion("1.0.9.93")]
35-
[assembly: AssemblyFileVersion("1.0.9.93")]
34+
[assembly: AssemblyVersion("1.0.10.93")]
35+
[assembly: AssemblyFileVersion("1.0.10.93")]

src/LZ4cc/AssemblyInfo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ using namespace System::Security::Permissions;
3434
// You can specify all the value or you can default the Revision and Build Numbers
3535
// by using the '*' as shown below:
3636

37-
[assembly:AssemblyVersionAttribute("1.0.9.93")];
37+
[assembly:AssemblyVersionAttribute("1.0.10.93")];
3838
[assembly:ComVisible(false)];
3939
[assembly:CLSCompliantAttribute(true)];
4040
[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];

src/LZ4cc/LZ4cc.vcxproj

-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
8585
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
8686
</ImportGroup>
87-
<PropertyGroup Label="UserMacros" />
8887
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8988
<ClCompile>
9089
<WarningLevel>Level3</WarningLevel>

src/LZ4cc/app.rc

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ END
4242
//
4343

4444
1 VERSIONINFO
45-
FILEVERSION 1,0,9,93
46-
PRODUCTVERSION 1,0,9,93
45+
FILEVERSION 1,0,10,93
46+
PRODUCTVERSION 1,0,10,93
4747
FILEFLAGSMASK 0x0L
4848
#ifdef _DEBUG
4949
FILEFLAGS 0x21L
@@ -60,11 +60,11 @@ BEGIN
6060
BEGIN
6161
VALUE "CompanyName", "Milosz Krajewski"
6262
VALUE "FileDescription", "LZ4cc"
63-
VALUE "FileVersion", "1.0.9.93"
63+
VALUE "FileVersion", "1.0.10.93"
6464
VALUE "LegalCopyright", "Copyright (c) 2014, Milosz Krajewski"
6565
VALUE "OriginalFilename", "LZ4cc.dll"
6666
VALUE "ProductName", "LZ4cc"
67-
VALUE "ProductVersion", "1.0.9.93"
67+
VALUE "ProductVersion", "1.0.10.93"
6868
END
6969
END
7070
BLOCK "VarFileInfo"

src/LZ4mm/AssemblyInfo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ using namespace System::Security::Permissions;
3434
// You can specify all the value or you can default the Revision and Build Numbers
3535
// by using the '*' as shown below:
3636

37-
[assembly:AssemblyVersionAttribute("1.0.9.93")];
37+
[assembly:AssemblyVersionAttribute("1.0.10.93")];
3838
[assembly:ComVisible(false)];
3939
[assembly:CLSCompliantAttribute(true)];
4040
[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];

src/LZ4mm/LZ4mm.vcxproj

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
9090
<IncludePath>..\..\original;..\adapters\cpp;$(IncludePath)</IncludePath>
9191
</PropertyGroup>
92-
<PropertyGroup Label="UserMacros" />
9392
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
9493
<ClCompile>
9594
<WarningLevel>Level3</WarningLevel>

src/LZ4mm/app.rc

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ END
4242
//
4343

4444
1 VERSIONINFO
45-
FILEVERSION 1,0,9,93
46-
PRODUCTVERSION 1,0,9,93
45+
FILEVERSION 1,0,10,93
46+
PRODUCTVERSION 1,0,10,93
4747
FILEFLAGSMASK 0x0L
4848
#ifdef _DEBUG
4949
FILEFLAGS 0x21L
@@ -60,11 +60,11 @@ BEGIN
6060
BEGIN
6161
VALUE "CompanyName", "Milosz Krajewski"
6262
VALUE "FileDescription", "LZ4mm"
63-
VALUE "FileVersion", "1.0.9.93"
63+
VALUE "FileVersion", "1.0.10.93"
6464
VALUE "LegalCopyright", "Copyright (c) 2014, Milosz Krajewski"
6565
VALUE "OriginalFilename", "LZ4mm.dll"
6666
VALUE "ProductName", "LZ4mm"
67-
VALUE "ProductVersion", "1.0.9.93"
67+
VALUE "ProductVersion", "1.0.10.93"
6868
END
6969
END
7070
BLOCK "VarFileInfo"

src/LZ4pn/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
// You can specify all the values or you can default the Build and Revision Numbers
2525
// by using the '*' as shown below:
2626
// [assembly: AssemblyVersion("1.0.*")]
27-
[assembly: AssemblyVersion("1.0.9.93")]
28-
[assembly: AssemblyFileVersion("1.0.9.93")]
27+
[assembly: AssemblyVersion("1.0.10.93")]
28+
[assembly: AssemblyFileVersion("1.0.10.93")]

src/LZ4ps/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
// You can specify all the values or you can default the Build and Revision Numbers
2525
// by using the '*' as shown below:
2626
// [assembly: AssemblyVersion("1.0.*")]
27-
[assembly: AssemblyVersion("1.0.9.93")]
28-
[assembly: AssemblyFileVersion("1.0.9.93")]
27+
[assembly: AssemblyVersion("1.0.10.93")]
28+
[assembly: AssemblyFileVersion("1.0.10.93")]

src/build.fsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Target "Release" (fun _ ->
131131
|> CopyFiles (releaseDir @@ "net4")
132132

133133
let fullSnk = (fileInfo strongFile).FullName
134-
let libzApp = "packages/LibZ.Bootstrap/tools/libz.exe"
134+
let libzApp = "packages/LibZ.Tool/tools/libz.exe"
135135
let libzArgs = sprintf """ inject-dll -a LZ4.dll -i *.dll -e LZ4.dll --move -k "%s" """ fullSnk
136136
{ defaultParams with
137137
Program = libzApp;

src/libLZ4/libLZ4.vcxproj

-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
106106
<IncludePath>..\original;$(IncludePath)</IncludePath>
107107
</PropertyGroup>
108-
<PropertyGroup Label="UserMacros" />
109108
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
110109
<ClCompile>
111110
<PrecompiledHeader>
+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{C6909539-ED25-4237-B6BC-AF4017B1622C}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>LZ4.MiniApp</RootNamespace>
11+
<AssemblyName>LZ4.MiniApp</AssemblyName>
12+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<PlatformTarget>AnyCPU</PlatformTarget>
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<PlatformTarget>AnyCPU</PlatformTarget>
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<Reference Include="System" />
36+
<Reference Include="System.Core" />
37+
<Reference Include="System.Xml.Linq" />
38+
<Reference Include="System.Data.DataSetExtensions" />
39+
<Reference Include="Microsoft.CSharp" />
40+
<Reference Include="System.Data" />
41+
<Reference Include="System.Xml" />
42+
</ItemGroup>
43+
<ItemGroup>
44+
<Compile Include="Program.cs" />
45+
<Compile Include="Properties\AssemblyInfo.cs" />
46+
</ItemGroup>
47+
<ItemGroup>
48+
<ProjectReference Include="..\..\LZ4\LZ4.csproj">
49+
<Project>{3db8e05b-22f8-4b64-8b0c-9ac95293ead5}</Project>
50+
<Name>LZ4</Name>
51+
</ProjectReference>
52+
</ItemGroup>
53+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
54+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
55+
Other similar extension points exist, see Microsoft.Common.targets.
56+
<Target Name="BeforeBuild">
57+
</Target>
58+
<Target Name="AfterBuild">
59+
</Target>
60+
-->
61+
</Project>

0 commit comments

Comments
 (0)