Provider<byte[]> codec = new ValueToJsonBytes(new AvroGenericToValue(avroProvider));
sink = new BytesLineSink(out).appendAll(codec);
return codec;
}
case CSV: {
Provider<List<String>> codec = new AvroGenericToStringList(avroProvider);
sink = new CsvSink(out, schema).appendAll(codec);
return codec;
}
case CSV_NO_HEADER: {
Provider<List<String>> codec = new AvroGenericToStringList(avroProvider);
sink = new CsvSink(out).appendAll(codec);
return codec;
}
case TSV: {
Provider<List<String>> codec = new AvroGenericToStringList(avroProvider);
sink = new TsvSink(out, schema).appendAll(codec);
return codec;
}
case TSV_NO_HEADER: {
Provider<List<String>> codec = new AvroGenericToStringList(avroProvider);
sink = new TsvSink(out).appendAll(codec);
return codec;
}
default:
throw new UnsupportedOperationException("Unsupported output format " + outFormat);