MCPcopy Create free account
hub / github.com/tinylib/msgp / EncodeMsg

Method EncodeMsg

msgp/setof/generated.go:1716–1731  ·  view source on GitHub ↗

EncodeMsg encodes the message to the writer.

(writer *msgp.Writer)

Source from the content-addressed store, hash-verified

1714
1715// EncodeMsg encodes the message to the writer.
1716func (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.
1734func (s Int16) MarshalMsg(bytes []byte) ([]byte, error) {

Callers 1

TestInt16_NilHandlingFunction · 0.95

Calls 3

WriteNilMethod · 0.80
WriteArrayHeaderMethod · 0.80
WriteInt16Method · 0.80

Tested by 1

TestInt16_NilHandlingFunction · 0.76