Comments (7)
Thank you for your feedback.
I don't know C++ implementation very well, and there are some possibilities to fail deserialization.
Would you upload serialized binary ("test.test") file?
Or, would you tell me the result of following?
FileStream fs = new FileStream("E:\\test.test", FileMode.Open, FileAccess.Read);
byte[] buf = new byte[fs.Length];
fs.Read(buf, 0, buf.Length);
Console.WriteLine(BitConverter.ToString(buf));
from msgpack-cli.
Hello yfakariya,
Here is the content of test.test extracted exactly as you specified above:
91-9A-0D-0A-0D-0A-0D-0A-0D-0A-0D-0A-0D-0A-0D-0A-0D-0A-0D-0A-0D-0A
(Windows confirms the file is 22 bytes in length)
from msgpack-cli.
Thank you sebjf.
I wonder why C++ serializer puts 0x0D in the stream. It looks like just tiny integer value 13, not any header value.
I think the serialized value should be:
91-9A-0A-0A-0A-0A-0A-0A-0A-0A-0A-0A
(12bytes)
MessagePack CLI's unpacker interprets the C++ generated binary as following:
1 element array
10 elements array, its values are 13, 10...
Extra 10 bytes(13,10,...)
I believe 0x0D after 0x9A represents integer value 13, so I will ask C++ implementers to why msgpack-c outs such values.
Would you tell me what version msgpack-C do you use?
from msgpack-cli.
I use 0.5.4, the same one as available here: http://sourceforge.net/projects/msgpack/files/msgpack/cpp/
Thank you for MessagePack - I was very impressed when looking through the CLI source investigating this bug, this project is quite a feat!
from msgpack-cli.
myFile.open("E:\\test.test");
This opens a file with text mode. Then 0x0a (LF) is converted to 0x0d 0x0a (CR LF).
You can correct your code:
myFile.open("E:\\test.test", std::ios_base::binary);
from msgpack-cli.
Ah. Yes. Thank you iwadon! And sorry about the erronous issue.
from msgpack-cli.
@iwadon Thank you for your great post!
from msgpack-cli.
Related Issues (20)
- Unpacker throws exception trying to read map length after IsMapHeader returns true HOT 1
- Buffering causes async unpacking to fail HOT 2
- Add a non-generic override to SerializerRepository
- EnumMemberAttribute does not work. (expectedly)
- Type Object in MessagePack HOT 1
- GetMemberName() causes NullReferenceException when using MessagePackSerializer.Get<T>() in Xamarin iOS
- [Unity][il2cpp]'class' is not registered in this resolver,resolver.StandardResolver HOT 2
- How to serialize and deserialize a List member in a class HOT 2
- Problem deserializing byte array - InvalidOperationException caused by Decoders.InvalidArrayHeader.Read call HOT 4
- about LZ4 HOT 1
- Unable to cast object of type on netcore HOT 1
- Custom Serialisation docs appear to be out of date. HOT 1
- PackAsync & UnpackAsync not working when passing data continuously using for loop c# HOT 1
- The unpacked value is not expected type HOT 2
- Authenticode Signing? HOT 2
- DateTime serialization and deserialization timezone HOT 3
- Enum Deserialization Not working? HOT 1
- Serializer.Unpack Continuosly Stream of Data => High Memory Usage HOT 3
- Serialization / deserialization speed optimizations HOT 2
- Serialization field order by declaration order HOT 3
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 msgpack-cli.