-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ArchiveComment Property to ZipArchive #341
base: master
Are you sure you want to change the base?
Conversation
@@ -24,7 +24,7 @@ internal IEnumerable<DirectoryEntryHeader> ReadSeekableHeader(Stream stream) | |||
SeekBackToHeader(stream, reader, DIRECTORY_END_HEADER_BYTES); | |||
var entry = new DirectoryEndHeader(); | |||
entry.Read(reader); | |||
|
|||
var comm = new ArchiveEncoding().Decode(entry.Comment); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't going to work properly. The instance of the encoding object needs to be passed from options. Maybe don't worry about decoding it yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i moved the decoding to ZipArchive.
I didn't want to change the type of Comment property on DirectoryEntryHeader.
So i converted the hex array to string and back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i moved the decoding to ZipArchive.
I didn't want to change the type of Comment property on DirectoryEntryHeader.
So i converted the hex array to string and back.
Now that I look at the code here. Why is this line insufficient?
I'm already decoding the comment there. Why are you turning that into a byte array and back? |
Because it does not work. Comment is string.empty after DirectoryEntryHeader.Read() has been executed The added test proves this. The property Comment is string on DirectoryEntryHeader. So the only way to get the decoding from SeekableZipHeaderFactory to ZipArchive is to save it temporarliy in the already existing property. Or do you have an better idea? |
Added ArchiveComment Property to ZipArchive