@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();
 }