Skip to content

Add methods to get compressed size and offset for each stream (folder) #310

Open
@orisano

Description

@orisano

First of all, thank you for creating and maintaining this excellent Go library for reading 7z files. It has been very helpful for our project.

Background

I'm working on implementing parallel access to 7z files stored in object storage. To achieve this efficiently, I need to be able to:

  1. Know the compressed size of each stream to make ranged GET requests
  2. Know the offset of each compressed stream to access specific parts

Feature Request

Please add two new methods to the Reader interface:

  1. A method to get the compressed size for each stream
  2. A method to get the offset position of each compressed stream in the archive

Use Case

This would enable efficient parallel processing of 7z files stored in object storage by:

  • Making precise ranged GET requests for specific streams
  • Allowing multiple workers to process different streams concurrently
  • Minimizing unnecessary data transfer

Technical Details

The requested methods could look something like:

// Returns the compressed size of the specified stream
func (r *Reader) GetStreamCompressedSize(streamIndex int) (uint64, error)

// Returns the offset of the specified stream in the archive
func (r *Reader) GetStreamOffset(streamIndex int) (uint64, error)

I'm happy to create a Pull Request for this feature if you think it would be helpful.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions