PeekValueLength returns the length of the encoded value at the start of b. Note: If this function succeeds, it's not a guarantee that decoding the value will succeed. `b` can point either at beginning of the "full tag" with the column id, or it can point to the beginning of the type part of the tag
(b []byte)
| 2328 | // The length returned is the full length of the encoded value, including the |
| 2329 | // entire tag. |
| 2330 | func PeekValueLength(b []byte) (typeOffset int, length int, err error) { |
| 2331 | if len(b) == 0 { |
| 2332 | return 0, 0, nil |
| 2333 | } |
| 2334 | var dataOffset int |
| 2335 | var typ Type |
| 2336 | typeOffset, dataOffset, _, typ, err = DecodeValueTag(b) |
| 2337 | if err != nil { |
| 2338 | return 0, 0, err |
| 2339 | } |
| 2340 | length, err = PeekValueLengthWithOffsetsAndType(b, dataOffset, typ) |
| 2341 | return typeOffset, length, err |
| 2342 | } |
| 2343 | |
| 2344 | // PeekValueLengthWithOffsetsAndType is the same as PeekValueLength, except it |
| 2345 | // expects a dataOffset and typ value from a previous call to DecodeValueTag |
no test coverage detected
searching dependent graphs…