SharpZipLib icon indicating copy to clipboard operation
SharpZipLib copied to clipboard

Add multistream support to BZip2

Open piksel opened this issue 5 years ago • 6 comments

Fixes #413. Fixes #162.

I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.

piksel avatar Feb 01 '20 14:02 piksel

(fixes #413 rather than 276?)

Numpsy avatar Feb 17 '20 12:02 Numpsy

Gah. Github! Instead of using the number I actually typed, it auto-completed to the first search result that started with the number (413).

piksel avatar Feb 17 '20 13:02 piksel

Not sure if this would be considered a real issue or not, but in case:

Does the usage of the Length property on the baseStream have any ramifications on the supported types of input stream?

Example: Say that I have a Zip file that contains a BZip2 file. With the current code I appear to be able to open a BZip2InputStream on the stream that is returned from ZipFile.GetInputStream and read the data from it, but with this change I get

System.NotSupportedException : InflaterInputStream Length is not supported

I'm not sure off hand is BZip2InputStream is inteded to support such streams though? (might possibly also happen if you tried it with a network stream or some such as well)

Numpsy avatar Feb 19 '20 13:02 Numpsy

In which release this will be available?

philippk80 avatar Mar 24 '20 12:03 philippk80

This will probably be in the next release. I have been super busy and neglected this unfortunately. Hopefully I will get time this weekend to fix current issues.

piksel avatar Mar 26 '20 11:03 piksel

@Numpsy I made suggestions that should make it compatible with non-seekable streams. It will not access Stream.Length if multistream is not enabled, and it defaults to enable it only if the input stream supports seeking.

piksel avatar Mar 29 '20 15:03 piksel