@Override
 public void save(DataOutput out) throws IOException {
   int size = data.size();
   Writer writer = PackedInts.getWriter(out, data.size(), data.getBitsPerValue());
   for (int i = 0; i < size; ++i) {
     long val = data.get(i);
     writer.add(val);
   }
   writer.finish();
 }
 @Override
 public long sizeInBytes() {
   return data.getBitsPerValue() * data.size();
 }
 @Override
 public long get(int idx) {
   return data.get(idx);
 }
 @Override
 public void add(int idx, long val) {
   data.set(idx, val);
 }