EncodeMsg encodes the message to the writer.
(writer *msgp.Writer)
| 859 | |
| 860 | // EncodeMsg encodes the message to the writer. |
| 861 | func (s Byte) EncodeMsg(writer *msgp.Writer) error { |
| 862 | if s == nil { |
| 863 | return writer.WriteNil() |
| 864 | } |
| 865 | err := writer.WriteArrayHeader(uint32(len(s))) |
| 866 | if err != nil { |
| 867 | return err |
| 868 | } |
| 869 | for k := range s { |
| 870 | err = writer.WriteByte(k) |
| 871 | if err != nil { |
| 872 | return err |
| 873 | } |
| 874 | } |
| 875 | return nil |
| 876 | } |
| 877 | |
| 878 | // MarshalMsg encodes the message to the bytes. |
| 879 | func (s Byte) MarshalMsg(bytes []byte) ([]byte, error) { |