(data []byte, value int32)
| 32 | } |
| 33 | |
| 34 | func AppendVarInt(data []byte, value int32) []byte { |
| 35 | ux := uint32(value) |
| 36 | for ux >= 0x80 { |
| 37 | data = append(data, byte(ux&0x7F)|0x80) |
| 38 | ux >>= 7 |
| 39 | } |
| 40 | return append(data, byte(ux)) |
| 41 | } |
| 42 | |
| 43 | func PutVarInt(data []byte, value int32) (n int) { |
| 44 | ux := uint32(value) |