private static List<byte[]> schemaPayloads(String topic, String schemaJson, String payloadsFile, Map<String, ?> configs) {
        try (KafkaAvroSerializer serializer = new KafkaAvroSerializer()) {
            List<byte[]> payloads = new ArrayList<>();
            AvroSchema schema = new AvroSchema(schemaJson);
            serializer.configure(configs, false);
            for (String payloadStr : Files.readAllLines(Path.of(payloadsFile), StandardCharsets.UTF_8)) {
                Object object = AvroSchemaUtils.toObject(payloadStr, schema);
                byte[] payload = serializer.serialize(topic, object);
                payloads.add(payload);
            }
            return payloads;
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }
Generates a list of byte arrays with specified size and mix of random and static content.

@param size        The size of each byte array.
@param randomRatio The fraction of each array that should be random (0.0 to 1.0).
@param count       The number of arrays to generate.
@return List of byte arrays, each containing a mix of random and static bytes.
tools/src/main/java/org/apache/kafka/tools/automq/PerfCommand.java