8 type Custom interface {
9 Pack(p []byte, opt *Options) (int, error)
10 Unpack(r io.Reader, length int, opt *Options) error
11 Size(opt *Options) int
15 type customFallback struct {
19 func (c customFallback) Pack(p []byte, val reflect.Value, opt *Options) (int, error) {
20 return c.custom.Pack(p, opt)
23 func (c customFallback) Unpack(r io.Reader, val reflect.Value, opt *Options) error {
24 return c.custom.Unpack(r, 1, opt)
27 func (c customFallback) Sizeof(val reflect.Value, opt *Options) int {
28 return c.custom.Size(opt)
31 func (c customFallback) String() string {
32 return c.custom.String()