EncodeMsg encodes the message to the writer.
(writer *msgp.Writer)
| 289 | |
| 290 | // EncodeMsg encodes the message to the writer. |
| 291 | func (s Int) EncodeMsg(writer *msgp.Writer) error { |
| 292 | if s == nil { |
| 293 | return writer.WriteNil() |
| 294 | } |
| 295 | err := writer.WriteArrayHeader(uint32(len(s))) |
| 296 | if err != nil { |
| 297 | return err |
| 298 | } |
| 299 | for k := range s { |
| 300 | err = writer.WriteInt(k) |
| 301 | if err != nil { |
| 302 | return err |
| 303 | } |
| 304 | } |
| 305 | return nil |
| 306 | } |
| 307 | |
| 308 | // MarshalMsg encodes the message to the bytes. |
| 309 | func (s Int) MarshalMsg(bytes []byte) ([]byte, error) { |