NewEncoder initializes a new Protobuf encoder to write to the specified buffer, which must be pre-allocated by the caller with sufficient space to hold the message(s) being written.
(p []byte)
| 15 | // NewEncoder initializes a new Protobuf encoder to write to the specified buffer, which must be |
| 16 | // pre-allocated by the caller with sufficient space to hold the message(s) being written. |
| 17 | func NewEncoder(p []byte) *Encoder { |
| 18 | return &Encoder{ |
| 19 | p: p, |
| 20 | offset: 0, |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | // EncodeBool writes a varint-encoded boolean value to the buffer preceded by the varint-encoded tag key. |
| 25 | func (e *Encoder) EncodeBool(tag int, v bool) { |
no outgoing calls