func (a Array) DebugString() string {
	if len(a) < 5 {
		return "<malformed>"
	}
	var buf bytes.Buffer
	buf.WriteString("Array")
	length, rem, _ := ReadLength(a)  
	buf.WriteByte('(')
	buf.WriteString(strconv.Itoa(int(length)))
	length -= 4
	buf.WriteString(")[")
	var elem Element
	var ok bool
	for length > 1 {
		elem, rem, ok = ReadElement(rem)
		length -= int32(len(elem))
		if !ok {
			buf.WriteString(fmt.Sprintf("<malformed (%d)>", length))
			break
		}
		fmt.Fprintf(&buf, "%s", elem.Value().DebugString())
		if length != 1 {
			buf.WriteByte(',')
		}
	}
	buf.WriteByte(']')
	return buf.String()
}
DebugString outputs a human readable version of Array. It will attempt to stringify the
valid components of the array even if the entire array is not valid.
package bsoncore
import (
	"bytes"
	"fmt"
	"io"
	"strconv"
)
func NewArrayLengthError(length, rem int) error {
	return lengthError("array", length, rem)
}
type Array []byte
func NewArrayFromReader(r io.Reader) (Array, error) {
	return newBufferFromReader(r)
}
func (a Array) Index(index uint) Value {
	value, err := a.IndexErr(index)
	if err != nil {
		panic(err)
	}
	return value
}
func (a Array) IndexErr(index uint) (Value, error) {
	elem, err := indexErr(a, index)
	if err != nil {
		return Value{}, err
	}
	return elem.Value(), err
}