(r io.ByteReader)
| 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 |
| 62 | // length plus one. |
| 63 | u64, err := binary.ReadUvarint(r) |
| 64 | if err != nil { |
| 65 | return 0, err |
| 66 | } |
| 67 | if tagIsNull(u64) { |
| 68 | return -1, nil |
| 69 | } |
| 70 | return tagLength(u64), nil |
| 71 | } |
| 72 | |
| 73 | func DecodeTagLength(b Bytes) int { |
| 74 | u64, n := binary.Uvarint(b) |