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 *UidPack, seek uint64)
| 407 | // Decode decodes the UidPack back into the list of uids. This is a stop-gap function, Decode would |
| 408 | // need to do more specific things than just return the list back. |
| 409 | func Decode(pack *UidPack, seek uint64) []uint64 { |
| 410 | out := make([]uint64, 0, ApproxLen(pack)) |
| 411 | dec := Decoder{Pack: pack} |
| 412 | |
| 413 | for uids := dec.Seek(seek, SeekStart); len(uids) > 0; uids = dec.Next() { |
| 414 | out = append(out, uids...) |
| 415 | } |
| 416 | return out |
| 417 | } |
| 418 | |
| 419 | // DecodeToBuffer is the same as Decode but it returns a z.Buffer which is |
| 420 | // calloc'ed and can be SHOULD be freed up by calling buffer.Release(). |