// ParseAsBER parses given byte sequence as multiple IEs.
ParseAsBER parses given byte sequence as multiple IEs.
// ParseAsBER parses given byte sequence as multiple IEs .
func ParseAsBER(b []byte) ([]*IE, error) {
	var ies []*IE
	for {
		if len(b) == 0 {
			break
		}
		i, err := ParseIERecursive(b)
		if err != nil {
			return nil, err
		}
		ies = append(ies, i)
		if len(i.IE) == 0 {
			b = b[i.MarshalLen():]
			continue
		}
		if i.IE[0].MarshalLen() < i.MarshalLen()-2 {
			var l = 2
			for _, ie := range i.IE {
				l += ie.MarshalLen()
			}
			b = b[l:]
			continue
		}
		b = b[i.MarshalLen():]
	}
	return ies, nil
}
func ParseAsBER ( b [ ] byte ) ( [ ] * IE , error ) { var ies [ ] * IE for { if len ( b ) == 0 { break } i , err := ParseIERecursive ( b ) if err != nil { return nil , err } ies = append ( ies , i ) if len ( i . IE ) == 0 { b = b [ i . MarshalLen ( ) : ] continue } if i . IE [ 0 ] . MarshalLen ( ) < i . MarshalLen ( ) - 2 { var l = 2 for _ , ie := range i . IE { l += ie . MarshalLen ( ) } b = b [ l : ] continue } b = b [ i . MarshalLen ( ) : ] } return ies , nil }
ParseAsBER parses given byte sequence as multiple IEs.
ParseAsBER parses given byte sequence as multiple IEs .