func BaseArray(r BaseType, n int) Ruler {
	return &baseArray{r: r, n: n}
}
BaseArray returns a matching unit that matches R n times.
package bpl
import (
	"bufio"
	"io"
	"reflect"
	"unsafe"
	"github.com/qiniu/x/bufiox"
)
func matchCharArray(n int, in *bufio.Reader, ctx *Context) (v interface{}, err error) {
	if n == 0 {
		return "", nil
	}
	b := make([]byte, n)
	_, err = io.ReadFull(in, b)
	if err != nil {
		return
	}
	return string(b), nil
}
func matchByteArray(n int, in *bufio.Reader, ctx *Context) (v interface{}, err error) {
	if n == 0 {
		return []byte(nil), nil
	}
	b := make([]byte, n)
	_, err = io.ReadFull(in, b)
	if err != nil {
		return
	}
	return b, nil
}
func matchBaseArray(R BaseType, n int, in *bufio.Reader, ctx *Context) (v interface{}, err error) {
	if n == 0 {
		return
	}
	t := baseTypes[R]
	v = t.newn(n)
	data := (*reflect.SliceHeader)(unsafe.Pointer(reflect.ValueOf(v).UnsafeAddr())).Data
	b := (*[1 << 30]byte)(unsafe.Pointer(data))
	_, err = io.ReadFull(in, b[:n*t.sizeOf])
	return
}
type baseArray struct {
	r BaseType
	n int
}
func (p *baseArray) Match(in *bufio.Reader, ctx *Context) (v interface{}, err error) {
	n := p.n
	return matchBaseArray(p.r, n, in, ctx)
}
func (p *baseArray) RetType() reflect.Type {
	return reflect.SliceOf(p.r.RetType())
}
func (p *baseArray) SizeOf() int {
	return p.r.SizeOf() * p.n
}