NewMessagePackDecoder function takes in a byte slice, and returns a pointer to newly created and initialized MessagePackCodecDecoder
(b []byte)
| 55 | // NewMessagePackDecoder function takes in a byte slice, and returns a pointer to newly created |
| 56 | // and initialized MessagePackCodecDecoder |
| 57 | func NewMessagePackDecoder(b []byte) *MessagePackCodecDecoder { |
| 58 | msgPack := NewMsgPackHandle() |
| 59 | return &MessagePackCodecDecoder{ |
| 60 | MessagePackCodec: &MessagePackCodec{ |
| 61 | MsgPack: msgPack, |
| 62 | b: &b, |
| 63 | dec: codec.NewDecoderBytes(b, msgPack), |
| 64 | }, |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | // Encode method for MessagePackCodec. It encodes the input value into a byte slice using MessagePack. |
| 69 | // Returns encoded byte slice or error. |