Beispiel #1
0
func ExampleMultipleAmf0_Marshals() {
	s := protocol.Amf0String("oryx")
	n := protocol.Amf0Number(1.0)
	b := protocol.Amf0Boolean(true)

	if b, err := core.Marshals(&s, &n, &b); err != nil {
		_ = err // error.
	} else {
		_ = b // use marshaled []byte
	}
}
Beispiel #2
0
func ExampleAmf0String_MarshalBinary() {
	s := protocol.Amf0String("oryx")

	var b []byte
	var err error
	if b, err = s.MarshalBinary(); err != nil {
		return
	}

	fmt.Println(len(b))
	fmt.Println(b)

	// Output:
	// 7
	// [2 0 4 111 114 121 120]
}