Comments (4)
Fixed in 1.1.7
from k4os.compression.lz4.
Caused by #18. Seems like it wasn't a good idea.
from k4os.compression.lz4.
Thank you, it works with the default datacontractserializer (text), but when using a binary reader/writer it causes a SerializationException:
System.Runtime.Serialization.SerializationException: There was an error deserializing the object of type LZ4Tests+TestClass. The input source is not correctly formatted. ---> System.Xml.XmlException: The input source is not correctly formatted.
Verified test with GZipStream.
[TestMethod]
public void LibEncodeDecode_Binary()
{
var obj = new TestClass { Test1 = "1" };
var serializer = new DataContractSerializer(typeof(TestClass));
byte[] bytes;
using (var ms = new MemoryStream())
{
using (var compressionStream = LZ4Stream.Encode(ms))
//using (var compressionStream = new System.IO.Compression.GZipStream(ms, System.IO.Compression.CompressionMode.Compress))
{
using (var writer = System.Xml.XmlDictionaryWriter.CreateBinaryWriter(compressionStream))
{
serializer.WriteObject(writer, obj);
}
}
bytes = ms.ToArray();
}
using (var ms = new MemoryStream(bytes))
{
using (var decompressionStream = LZ4Stream.Decode(ms))
//using (var decompressionStream = new System.IO.Compression.GZipStream(ms, System.IO.Compression.CompressionMode.Decompress))
{
using (var reader = System.Xml.XmlDictionaryReader.CreateBinaryReader(decompressionStream, System.Xml.XmlDictionaryReaderQuotas.Max))
{
var o = serializer.ReadObject(reader) as TestClass;
Assert.AreEqual(obj.Test1, o.Test1);
}
}
}
}
from k4os.compression.lz4.
...and fixed again, in 1.1.9 this time
from k4os.compression.lz4.
Related Issues (20)
- Thank you! HOT 1
- Issue migrating from lz4net to K4os.Compression.LZ4.Legacy HOT 2
- Can't Build. Restore:Corpus Execution failed with error code 2 HOT 2
- Question: ReadAsync on LZ4EncoderStream? HOT 3
- Is it possible to create a "backward compatible" stream? HOT 7
- can't decode HOT 5
- Different Output After Copying Stream HOT 5
- Decode with endOnOutputSize HOT 1
- Dependency to System.Memory is not needed for .NET Standard 2.1 and .NET 5.0 HOT 5
- A way to perform block decompression using an initial dictionary HOT 6
- excuse me, it work to Unity Engine? HOT 3
- Compatibility Problem with other implementations HOT 4
- How to uncompress an LZ4 archive that has multiple files? HOT 2
- [Feature] Optimized LZ4 Frame aware encoding/decoding to stream HOT 6
- [Feature]: .NET 6 target and assembly trimming HOT 3
- Unity Support HOT 3
- Implicit reference to System.Runtime.CompilerServices.Unsafe appears to cause wrong version to be selected HOT 3
- Chained encoder does not produce the same result as the lz4 cli when chaining is enabled HOT 4
- Migrating from L4zNet to new implementation
- InvalidDataException: LZ4 frame magic number expected HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from k4os.compression.lz4.