super(packages);
}
@SuppressWarnings("unchecked")
public void marshal(Exchange exchange, Object body, OutputStream outputStream) throws Exception {
BindyAbstractFactory factory = getFactory(exchange.getContext().getPackageScanClassResolver());
List<Map<String, Object>> models = (ArrayList<Map<String, Object>>)body;
byte[] crlf;
// Get CRLF
crlf = ConverterUtils.getByteReturn(factory.getCarriageReturn());
for (Map<String, Object> model : models) {
String result = factory.unbind(model);
byte[] bytes = exchange.getContext().getTypeConverter().convertTo(byte[].class, exchange, result);
outputStream.write(bytes);
// Add a carriage return
outputStream.write(crlf);