archive15.go
func (a *archive15) next() (*fileBlockHeader, error) {
	for {
		// could return an io.EOF here as 1.5 archives may not have an end block.
		h, err := a.readBlockHeader()
		if err != nil {
			return nil, err
		}
		a.byteReader = limitByteReader(a.v, h.dataSize) // reader for block data

		switch h.htype {
		case blockFile:
			return a.parseFileHeader(h)
		case blockArc:
			a.encrypted = h.flags&arcEncrypted > 0
			a.multi = h.flags&arcVolume > 0
			a.old = h.flags&arcNewNaming == 0
			a.solid = h.flags&arcSolid > 0
		case blockEnd:
			if h.flags&endArcNotLast == 0 || !a.multi {
				return nil, errArchiveEnd
			}
			return nil, errArchiveContinues
		default:
			_, err = io.Copy(ioutil.Discard, a.byteReader)
		}
		if err != nil {
			return nil, err
		}
	}
}
func (a *archive15) next() (*fileBlockHeader, error) {
	for {
		// could return an io.EOF here as 1.5 archives may not have an end block.
		h, err := a.readBlockHeader()
		if err != nil {
			return nil, err
		}
		a.byteReader = limitByteReader(a.v, h.dataSize) // reader for block data

		switch h.htype {
		case blockFile:
			return a.parseFileHeader(h)
		case blockArc:
			a.encrypted = h.flags&arcEncrypted > 0
			a.multi = h.flags&arcVolume > 0
			a.old = h.flags&arcNewNaming == 0
			a.solid = h.flags&arcSolid > 0
		case blockEnd:
			if h.flags&endArcNotLast == 0 || !a.multi {
				return nil, errArchiveEnd
			}
			return nil, errArchiveContinues
		default:
			_, err = io.Copy(ioutil.Discard, a.byteReader)
		}
		if err != nil {
			return nil, err
		}
	}
}
// next advances to the next file block in the archive