EntryStream.Length should delegate to the underlying stream #294

Closed
opened 2026-01-29 22:09:38 +00:00 by claunia · 2 comments
Owner

Originally created by @coderb on GitHub (Apr 26, 2018).

adam-

Could you please make the change below?

I have a use case where I want to check the uncompressed stream size.

thanks,
b

EntryStream.cs:
from:
public override long Length
{
get { throw new NotSupportedException(); }
}

to:
public override long Length
{
get { return stream.Length; }
}

Originally created by @coderb on GitHub (Apr 26, 2018). adam- Could you please make the change below? I have a use case where I want to check the uncompressed stream size. thanks, b EntryStream.cs: from: public override long Length { get { throw new NotSupportedException(); } } to: public override long Length { get { return stream.Length; } }
Author
Owner

@adamhathcock commented on GitHub (Apr 26, 2018):

Are you sure that would work? Usually the streams don't know their length because they're compressed. I guess certain use-cases it would work.

@adamhathcock commented on GitHub (Apr 26, 2018): Are you sure that would work? Usually the streams don't know their length because they're compressed. I guess certain use-cases it would work.
Author
Owner

@coderb commented on GitHub (Apr 26, 2018):

It works for RARs as the header contains the uncomrpessed size and hopefully for others that don't know will continue to throw NotSupportedException.

@coderb commented on GitHub (Apr 26, 2018): It works for RARs as the header contains the uncomrpessed size and hopefully for others that don't know will continue to throw NotSupportedException.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#294