EncodeMsg implements [Encodable]. It writes the raw bytes to the writer. If r is empty, it writes 'nil' instead.
(w *Writer)
| 97 | // It writes the raw bytes to the writer. |
| 98 | // If r is empty, it writes 'nil' instead. |
| 99 | func (r Raw) EncodeMsg(w *Writer) error { |
| 100 | if len(r) == 0 { |
| 101 | return w.WriteNil() |
| 102 | } |
| 103 | _, err := w.Write([]byte(r)) |
| 104 | return err |
| 105 | } |
| 106 | |
| 107 | // DecodeMsg implements [Decodable]. |
| 108 | // It sets the value of *Raw to be the |