Decode decodes the UidPack back into the list of uids. This is a stop-gap function, Decode would need to do more specific things than just return the list back.
(pack *pb.UidPack, seek uint64)
| 442 | // Decode decodes the UidPack back into the list of uids. This is a stop-gap function, Decode would |
| 443 | // need to do more specific things than just return the list back. |
| 444 | func Decode(pack *pb.UidPack, seek uint64) []uint64 { |
| 445 | out := make([]uint64, 0, ApproxLen(pack)) |
| 446 | dec := Decoder{Pack: pack} |
| 447 | |
| 448 | for uids := dec.Seek(seek, SeekStart); len(uids) > 0; uids = dec.Next() { |
| 449 | out = append(out, uids...) |
| 450 | } |
| 451 | return out |
| 452 | } |
| 453 | |
| 454 | // DecodeToBuffer is the same as Decode but it returns a z.Buffer which is |
| 455 | // calloc'ed and can be SHOULD be freed up by calling buffer.Release(). |