NewMessagePackEncoder function creates new MessagePackCodecEncoder and initializes it.
()
| 41 | |
| 42 | // NewMessagePackEncoder function creates new MessagePackCodecEncoder and initializes it. |
| 43 | func NewMessagePackEncoder() *MessagePackCodecEncoder { |
| 44 | msgPack := NewMsgPackHandle() |
| 45 | b := make([]byte, 0) |
| 46 | return &MessagePackCodecEncoder{ |
| 47 | MessagePackCodec: MessagePackCodec{ |
| 48 | MsgPack: msgPack, |
| 49 | b: &b, |
| 50 | enc: codec.NewEncoderBytes(&b, msgPack), |
| 51 | }, |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | // NewMessagePackDecoder function takes in a byte slice, and returns a pointer to newly created |
| 56 | // and initialized MessagePackCodecDecoder |