VariableIntSlice writes an int64 slice using variable-length encoding. Smaller values use less space at the cost of larger values using more space, but this is generally more space-efficient. This does carry a computational hit when reading.
(vals []int64)
| 251 | // larger values using more space, but this is generally more space-efficient. This does carry a computational hit when |
| 252 | // reading. |
| 253 | func (writer *Writer) VariableIntSlice(vals []int64) { |
| 254 | writer.VariableUint(uint64(len(vals))) |
| 255 | for i := range vals { |
| 256 | writer.VariableInt(vals[i]) |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | // VariableUintSlice writes a uint64 slice using variable-length encoding. Smaller values use less space at the cost of |
| 261 | // larger values using more space, but this is generally more space-efficient. This does carry a computational hit when |