(b Bytes)
| 71 | } |
| 72 | |
| 73 | func DecodeTagLength(b Bytes) int { |
| 74 | u64, n := binary.Uvarint(b) |
| 75 | if n <= 0 { |
| 76 | panic(fmt.Sprintf("bad uvarint: %d", n)) |
| 77 | } |
| 78 | if tagIsNull(u64) { |
| 79 | return n |
| 80 | } |
| 81 | return int(u64) + n - 1 |
| 82 | } |
| 83 | |
| 84 | func toTag(length int) uint64 { |
| 85 | return uint64(length) + 1 |