func (e *Encoder) write(b []byte) error { if e.packed { e.packbuf = packed.Pack(e.packbuf[:0], b) b = e.packbuf } _, err := e.w.Write(b) return err }
// MarshalPacked marshals the message in packed form. func (m *Message) MarshalPacked() ([]byte, error) { data, err := m.Marshal() if err != nil { return nil, err } buf := make([]byte, 0, len(data)) buf = packed.Pack(buf, data) return buf, nil }