func main() {
	var data []byte
	sendingBuf, _ := y3.NewCodec(0x10).Marshal(data)
	source := y3.FromStream(bytes.NewReader(sendingBuf))
	var decode = func(v []byte) (interface{}, error) {
		sl, err := y3.ToBytes(v)
		if err != nil {
			return nil, err
		}
		fmt.Printf("encoded slice len: %v\n", len(sl))
		return sl, nil
	}
	consumer := source.Subscribe(0x10).OnObserve(decode)
	for range consumer {
	}
}
Example of encoding and decoding string []byte type, value is nil.
package main
import (
	"bytes"
	"fmt"
	"github.com/yomorun/y3-codec-golang"
)