EncodeMsg encodes the message to the writer.
(writer *msgp.Writer)
| 1714 | |
| 1715 | // EncodeMsg encodes the message to the writer. |
| 1716 | func (s Int16) EncodeMsg(writer *msgp.Writer) error { |
| 1717 | if s == nil { |
| 1718 | return writer.WriteNil() |
| 1719 | } |
| 1720 | err := writer.WriteArrayHeader(uint32(len(s))) |
| 1721 | if err != nil { |
| 1722 | return err |
| 1723 | } |
| 1724 | for k := range s { |
| 1725 | err = writer.WriteInt16(k) |
| 1726 | if err != nil { |
| 1727 | return err |
| 1728 | } |
| 1729 | } |
| 1730 | return nil |
| 1731 | } |
| 1732 | |
| 1733 | // MarshalMsg encodes the message to the bytes. |
| 1734 | func (s Int16) MarshalMsg(bytes []byte) ([]byte, error) { |