func (b *ScriptBuilder) AddData(data []byte) *ScriptBuilder {
	l := len(data)
	buffer := b.buffer
	switch {
	case l == 0:
		buffer.WriteU8(OP_0)
		return b
	case l == 1:
		switch {
		case data[0] == 0:
			buffer.WriteU8(OP_0)
			return b
		case data[0] <= 16:
			buffer.WriteU8((OP_1 - 1) + data[0])
			return b
		case data[0] == 0x81:
			buffer.WriteU8(OP_1NEGATE)
			return b
		}
		fallthrough
	case l < OP_PUSHDATA1:
		buffer.WriteU8(uint8((OP_DATA_1 - 1) + l))
	case l <= 0xff:
		buffer.WriteU8(OP_PUSHDATA1)
		buffer.WriteU8(uint8(l))
	case l <= 0xffff:
		buffer.WriteU8(OP_PUSHDATA2)
		buffer.WriteU16(uint32(l))
	default:
		buffer.WriteU8(OP_PUSHDATA4)
		buffer.WriteU32(uint32(l))
	}
	buffer.WriteBytes(data)
	return b
}
AddData -- push the passed data to the end of the script
package xvm
import (
	"errors"
	"fmt"
	"strconv"
	"strings"
	"encoding/hex"
	"github.com/keyfuse/tokucore/xbase"
	"github.com/keyfuse/tokucore/xcrypto"
)
type ScriptBuilder struct {
	buffer *xbase.Buffer
	err    error
}
func NewScriptBuilder() *ScriptBuilder {
	return &ScriptBuilder{
		buffer: xbase.NewBuffer(),
	}
}