func (sz *Reader) Next() (*headers.FileInfo, error) {
	if sz.err != nil {
		return nil, sz.err
	}
	hdr, err := sz.next()
	sz.err = err
	return hdr, err
}
Next advances to the next entry in the 7z archive.

io.EOF is returned at the end of the input.
package go7z
import (
	"bufio"
	"errors"
	"fmt"
	"hash/crc32"
	"io"
	"os"
	"sync"
	"github.com/saracen/go7z/headers"
	"github.com/saracen/solidblock"
)
var (
	ErrNotSupported = errors.New("not supported")
	ErrDecompressorNotFound = errors.New("decompressor not found")
)
type Reader struct {
	r   *io.SectionReader
	err error
	header *headers.Header
	folderIndex int
	fileIndex   int
	emptyStream bool
	folders []*folderReader
	Options ReaderOptions
}
type ReaderOptions struct {
	password string
	cb       func() string
}
func (o *ReaderOptions) SetPassword(password string) {
	o.password = password
}
func (o *ReaderOptions) SetPasswordCallback(cb func() string) {
	o.cb = cb
}
func (o *ReaderOptions) Password() string {
	if o.password != "" {
		return o.password
	}
	if o.cb != nil {
		o.password = o.cb()
	}
	return o.password
}
type ReadCloser struct {
	f *os.File
	Reader
}
func (rc *ReadCloser) Close() error {
	return rc.f.Close()
}
func OpenReader(name string) (*ReadCloser, error) {
	f, err := os.Open(name)
	if err != nil {
		return nil, err
	}
	fi, err := f.Stat()
	if err != nil {
		f.Close()
		return nil, err
	}
	r := new(ReadCloser)
	if err := r.init(f, fi.Size(), false); err != nil {
		f.Close()
		return nil, err
	}
	r.f = f
	return r, nil
}
func NewReader(r io.ReaderAt, size int64) (*Reader, error) {
	szr := new(Reader)
	if err := szr.init(r, size, false); err != nil {
		return nil, err
	}
	return szr, nil
}
func (sz *Reader) init(r io.ReaderAt, size int64, ignoreChecksumError bool) error {
	sz.r = io.NewSectionReader(r, 0, size)
	signatureHeader, err := headers.ReadSignatureHeader(sz.r)
	if err != nil {
		if !(ignoreChecksumError && err == headers.ErrChecksumMismatch) {
			return err
		}
	}
	if _, err := sz.r.Seek(signatureHeader.StartHeader.NextHeaderOffset, io.SeekCurrent); err != nil {
		return err
	}
	if signatureHeader.StartHeader.NextHeaderSize > size-headers.SignatureHeaderSize {
		return io.ErrUnexpectedEOF
	}
	crc := crc32.NewIEEE()
	tee := io.TeeReader(bufio.NewReader(io.LimitReader(sz.r, signatureHeader.StartHeader.NextHeaderSize)), crc)
	header, encoded, err := headers.ReadPackedStreamsForHeaders(&io.LimitedReader{tee, signatureHeader.StartHeader.NextHeaderSize})
	if err != nil {
		return err
	}
	if crc.Sum32() != signatureHeader.StartHeader.NextHeaderCRC {
		if !ignoreChecksumError {
			return headers.ErrChecksumMismatch
		}
	}
	if encoded != nil {
		folders, err := sz.extract(encoded)
		if err != nil {
			return err
		}
		if len(folders) != 1 {
			return ErrNotSupported
		}
		if err = folders[0].Next(); err != nil {
			return err
		}
		header, _, err = headers.ReadPackedStreamsForHeaders(&io.LimitedReader{folders[0].sb, folders[0].sb.Size()})
		if err != nil {
			return err
		}
		if err = folders[0].Next(); err != io.EOF {
			return ErrNotSupported
		}
	}
	if header == nil {
		return ErrNotSupported
	}
	sz.header = header
	sz.folders, err = sz.extract(sz.header.MainStreamsInfo)
	return err
}