The Decode method under a valid previous made file works well, but if i try to recreate the binary file on my program it ouput empty classes, just the first class gets ok (Header)
)
Files.zip
How to recreate the problem using the GUI: open the .sl1 file -> Go to Edit menu - Convert - Save the file.
PS: There are missing objects to enconde but that doesn't matter since first 3 classes should return valid content which doesn't happen.
Giving that when i set the position address it will be in wrong position due the use of SizeOf
When analising original file, the header is 112 bytes, why write operation is outputing more?
EDIT 2: Found the problem, i was using stream.GetBuffer() instead of stream.ToArray() which cause wrong output
I'm having a trouble and spent many hours trying to debug, but no matter what i try when i read back the pervious write it output a empty class.
The encoding starts at: https://github.com/sn4k3/PrusaSL1Viewer/blob/master/PrusaSL1Reader/CbddlpFile.cs -> public override void BeginEncode(string fileFullPath)
The Decode method under a valid previous made file works well, but if i try to recreate the binary file on my program it ouput empty classes, just the first class gets ok (Header) ) Files.zip
How to recreate the problem using the GUI: open the .sl1 file -> Go to Edit menu - Convert - Save the file.
PS: There are missing objects to enconde but that doesn't matter since first 3 classes should return valid content which doesn't happen.
Debug output from Write operation
Debug from Read back operation
As can be observed after Header, everything comes empty
EDIT 1: I found part of the problem, it seens serializer sizeof is returning diferent values from encoded byte count:
Giving that when i set the position address it will be in wrong position due the use of SizeOf When analising original file, the header is 112 bytes, why write operation is outputing more?
EDIT 2: Found the problem, i was using stream.GetBuffer() instead of stream.ToArray() which cause wrong output