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 ExampleAmf0Number_MarshalBinary() {
	s := protocol.Amf0Number(100.0)

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

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

	// Output:
	// 9
	// [0 64 89 0 0 0 0 0 0]
}