// Duplicate the random data until we have filled "len" bytes
Slice dst = Slices.allocate(len);
SliceOutput sliceOutput = dst.output();
while (sliceOutput.size() < len) {
sliceOutput.writeBytes(rawData, 0, Math.min(rawData.length(), sliceOutput.writableBytes()));
}
return dst;
}
private static Slice generateRandomSlice(Random random, int length)