Skip to content

Commit

Permalink
fix: make OpenRaw return SectionReader (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
t0rr3sp3dr0 authored Feb 8, 2025
1 parent daaf987 commit 78a8aef
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/xar/xar.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,11 @@ func (f *File) Open() (rc io.ReadCloser, err error) {
return rc, err
}

// OpenRaw returns a ReadCloser that provides access to the file's
// OpenRaw returns a SectionReader that provides access to the file's
// raw content. The encoding of the raw content is specified in
// the File's EncodingMimetype field.
func (f *File) OpenRaw() (rc io.ReadCloser, err error) {
rc = ioutil.NopCloser(io.NewSectionReader(f.heap, f.offset, f.length))
return
func (f *File) OpenRaw() *io.SectionReader {
return io.NewSectionReader(f.heap, f.offset, f.length)
}

// Verify that the compressed content of the File in the
Expand Down

0 comments on commit 78a8aef

Please sign in to comment.