func ToUInt64Slice(v []byte) ([]uint64, error) {
	packet, _, err := DecodeNodePacket(v)
	if err != nil {
		return nil, err
	}
	if !packet.IsSlice() {
		return nil, fmt.Errorf("v not a slice: %v", utils.FormatBytes(v))
	}
	result := make([]uint64, 0)
	for _, p := range packet.PrimitivePackets {
		v, _ := p.ToUInt64()
		result = append(result, v)
	}
	return result, nil
}
ToUInt64Slice decode bytes to []uint64
package y3
import (
	"fmt"
	"github.com/yomorun/y3-codec-golang/internal/utils"
)
func ToObject(v []byte, output interface{}) error {
	_, err := newStructDecoder(output).Decode(v)  
	return err
}
func ToInt32(v []byte) (int32, error) {
	primitivePacket, _, _, err := DecodePrimitivePacket(v)
	if err != nil {
		return 0, err
	}
	value, err := primitivePacket.ToInt32()
	if err != nil {
		return 0, nil
	}
	return value, nil
}
func ToInt32Slice(v []byte) ([]int32, error) {
	packet, _, err := DecodeNodePacket(v)
	if err != nil {
		return nil, err
	}
	if !packet.IsSlice() {
		return nil, fmt.Errorf("v not a slice: %v", utils.FormatBytes(v))
	}
	result := make([]int32, 0)
	for _, p := range packet.PrimitivePackets {
		v, _ := p.ToInt32()
		result = append(result, v)
	}
	return result, nil
}
func ToUInt32(v []byte) (uint32, error) {
	primitivePacket, _, _, err := DecodePrimitivePacket(v)
	if err != nil {
		return 0, err
	}
	value, err := primitivePacket.ToUInt32()
	if err != nil {
		return 0, nil
	}
	return value, nil
}
func ToUInt32Slice(v []byte) ([]uint32, error) {
	packet, _, err := DecodeNodePacket(v)
	if err != nil {
		return nil, err
	}
	if !packet.IsSlice() {
		return nil, fmt.Errorf("v not a slice: %v", utils.FormatBytes(v))
	}
	result := make([]uint32, 0)
	for _, p := range packet.PrimitivePackets {
		v, _ := p.ToUInt32()
		result = append(result, v)
	}
	return result, nil
}
func ToInt64(v []byte) (int64, error) {
	primitivePacket, _, _, err := DecodePrimitivePacket(v)
	if err != nil {
		return 0, err
	}
	value, err := primitivePacket.ToInt64()
	if err != nil {
		return 0, nil
	}
	return value, nil
}
func ToInt64Slice(v []byte) ([]int64, error) {
	packet, _, err := DecodeNodePacket(v)
	if err != nil {
		return nil, err
	}
	if !packet.IsSlice() {
		return nil, fmt.Errorf("v not a slice: %v", utils.FormatBytes(v))
	}
	result := make([]int64, 0)
	for _, p := range packet.PrimitivePackets {
		v, _ := p.ToInt64()
		result = append(result, v)
	}
	return result, nil
}
func ToUInt64(v []byte) (uint64, error) {
	primitivePacket, _, _, err := DecodePrimitivePacket(v)
	if err != nil {
		return 0, err
	}
	value, err := primitivePacket.ToUInt64()
	if err != nil {
		return 0, nil
	}
	return value, nil
}