SizeOfUvarint returns the number of bytes required by binary.AppendUvarint to represent u64.
(u64 uint64)
| 49 | // SizeOfUvarint returns the number of bytes required by binary.AppendUvarint to |
| 50 | // represent u64. |
| 51 | func SizeOfUvarint(u64 uint64) int { |
| 52 | n := 1 |
| 53 | for u64 >= 0x80 { |
| 54 | n++ |
| 55 | u64 >>= 7 |
| 56 | } |
| 57 | return n |
| 58 | } |
| 59 | |
| 60 | func ReadTag(r io.ByteReader) (int, error) { |
| 61 | // The tag is zero for a null value; otherwise, it is the value's |
no outgoing calls
no test coverage detected