func (i *IE) MarshalBinary() ([]byte, error) {
	b := make([]byte, i.MarshalLen())
	if err := i.MarshalTo(b); err != nil {
		return nil, err
	}
	return b, nil
}
MarshalBinary returns the byte sequence generated from a IE instance.
package tcap
import (
	"fmt"
	"io"
)
type Tag uint8
const (
	Universal int = iota
	ApplicationWide
	ContextSpecific
	Private
)
const (
	Primitive int = iota
	Constructor
)
func NewTag(cls, form, code int) Tag {
	return Tag((cls << 6) | (form << 5) | code)
}
func NewUniversalPrimitiveTag(code int) Tag {
	return NewTag(Universal, Primitive, code)
}
func NewUniversalConstructorTag(code int) Tag {
	return NewTag(Universal, Constructor, code)
}
func NewApplicationWidePrimitiveTag(code int) Tag {
	return NewTag(ApplicationWide, Primitive, code)
}
func NewApplicationWideConstructorTag(code int) Tag {
	return NewTag(ApplicationWide, Constructor, code)
}
func NewContextSpecificPrimitiveTag(code int) Tag {
	return NewTag(ContextSpecific, Primitive, code)
}
func NewContextSpecificConstructorTag(code int) Tag {
	return NewTag(ContextSpecific, Constructor, code)
}
func NewPrivatePrimitiveTag(code int) Tag {
	return NewTag(Private, Primitive, code)
}
func NewPrivateConstructorTag(code int) Tag {
	return NewTag(Private, Constructor, code)
}
func (t Tag) Class() int {
	return int(t) >> 6 & 0x3
}
func (t Tag) Form() int {
	return int(t) >> 5 & 0x1
}
func (t Tag) Code() int {
	return int(t) & 0x1f
}
type IE struct {
	Tag
	Length uint8
	Value  []byte
	IE     []*IE
}
func NewIE(tag Tag, value []byte) *IE {
	i := &IE{
		Tag:   tag,
		Value: value,
	}
	i.SetLength()
	return i
}