func (enc *PrimitivePacketEncoder) SetInt32Value(v int32) {
	size := encoding.SizeOfPVarInt32(v)
	codec := encoding.VarCodec{Size: size}
	enc.valbuf = make([]byte, size)
	err := codec.EncodePVarInt32(enc.valbuf, v)
	if err != nil {
		panic(err)
	}
}
SetInt32Value encode int32 value
package y3
import (
	"bytes"
	"fmt"
	"github.com/yomorun/y3-codec-golang/pkg/encoding"
)
type encoder struct {
	seqID   int
	valbuf  []byte
	isNode  bool
	isArray bool
	buf     *bytes.Buffer
}
type iEncoder interface {
	Encode() []byte
}
func (enc *encoder) GetValBuf() []byte {
	return enc.valbuf
}
func (enc *encoder) IsEmpty() bool {
	return len(enc.valbuf) == 0
}
func (enc *encoder) String() string {
	return fmt.Sprintf("Encoder: isNode=%v | seqID=%#x | valBuf=%#v | buf=%#v", enc.isNode, enc.seqID, enc.valbuf, enc.buf)
}
type PrimitivePacketEncoder struct {
	encoder
}
func NewPrimitivePacketEncoder(sid int) *PrimitivePacketEncoder {
	primEnc := &PrimitivePacketEncoder{
		encoder: encoder{
			isNode: false,
			buf:    new(bytes.Buffer),
		},
	}
	primEnc.seqID = sid
	return primEnc
}