func (br *BIOSRegion) Apply(v Visitor) error {
	return v.Visit(br)
}
Apply calls the visitor on the BIOSRegion.
package uefi
import (
	"errors"
)
type BIOSPadding struct {
	buf    []byte
	Offset uint64
	ExtractPath string
}
func NewBIOSPadding(buf []byte, offset uint64) (*BIOSPadding, error) {
	bp := &BIOSPadding{buf: buf, Offset: offset}
	return bp, nil
}
func (bp *BIOSPadding) Buf() []byte {
	return bp.buf
}
func (bp *BIOSPadding) SetBuf(buf []byte) {
	bp.buf = buf
}
func (bp *BIOSPadding) Apply(v Visitor) error {
	return v.Visit(bp)
}
func (bp *BIOSPadding) ApplyChildren(v Visitor) error {
	return nil
}
type BIOSRegion struct {
	buf      []byte
	Elements []*TypedFirmware `json:",omitempty"`
	ExtractPath string
	Length      uint64
	FRegion    *FlashRegion
	RegionType FlashRegionType
}
func (br *BIOSRegion) Type() FlashRegionType {
	return RegionTypeBIOS
}
func (br *BIOSRegion) SetFlashRegion(fr *FlashRegion) {
	br.FRegion = fr
}
func (br *BIOSRegion) FlashRegion() (fr *FlashRegion) {
	return br.FRegion
}
func NewBIOSRegion(buf []byte, r *FlashRegion, _ FlashRegionType) (Region, error) {
	br := BIOSRegion{FRegion: r, Length: uint64(len(buf)),
		RegionType: RegionTypeBIOS}
	var absOffset uint64
	if ReadOnly {
		br.buf = buf
	} else {
		br.buf = make([]byte, len(buf))
		copy(br.buf, buf)
	}
	for {
		offset := FindFirmwareVolumeOffset(buf)
		if offset < 0 {
			if len(buf) != 0 {
				bp, err := NewBIOSPadding(buf, absOffset)
				if err != nil {
					return nil, err
				}
				br.Elements = append(br.Elements, MakeTyped(bp))
			}
			break
		}
		if offset > 0 {
			bp, err := NewBIOSPadding(buf[:offset], absOffset)
			if err != nil {
				return nil, err
			}
			br.Elements = append(br.Elements, MakeTyped(bp))
		}
		absOffset += uint64(offset)                                   
		fv, err := NewFirmwareVolume(buf[offset:], absOffset, false)  
		if err != nil {
			return nil, err
		}
		absOffset += fv.Length
		buf = buf[uint64(offset)+fv.Length:]
		br.Elements = append(br.Elements, MakeTyped(fv))
	}
	return &br, nil
}
func (br *BIOSRegion) Buf() []byte {
	return br.buf
}
func (br *BIOSRegion) SetBuf(buf []byte) {
	br.buf = buf
}