(buf []byte)
| 330 | } |
| 331 | |
| 332 | func decodeCompatInt64(buf []byte) (int64, int, error) { |
| 333 | if len(buf) == 0 { |
| 334 | return 0, 0, ErrHintFileCorrupted |
| 335 | } |
| 336 | fileID, n := binary.Varint(buf) |
| 337 | if n > 0 { |
| 338 | var encoded [binary.MaxVarintLen64]byte |
| 339 | m := binary.PutVarint(encoded[:], fileID) |
| 340 | if n == m && bytes.Equal(buf[:n], encoded[:m]) { |
| 341 | return fileID, n, nil |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | uval, n2 := binary.Uvarint(buf) |
| 346 | if n2 > 0 { |
| 347 | return int64(uval), n2, nil |
| 348 | } |
| 349 | |
| 350 | return 0, 0, ErrHintFileCorrupted |
| 351 | } |
| 352 | |
| 353 | func readCompatInt64(r *bufio.Reader, fieldsRead *int) (int64, error) { |
| 354 | var scratch [binary.MaxVarintLen64]byte |
no outgoing calls
no test coverage detected