}
if (lastItem != 0) {
builder.addRunLengths(counter);
values.add(lastItem);
}
builder.setValues(ByteString.copyFrom(values.toArray()));
return builder.build();
}
private static TeraArray runLengthDecode(EntityData.RunLengthEncoding16 data) {
Preconditions.checkState(data.getValuesCount() == data.getRunLengthsCount(), "Expected same number of values as runs");