outputStream.write(encoded.getBytes());
}
public Object unmarshal(Exchange exchange, InputStream inputStream) throws Exception {
String body = ExchangeHelper.convertToMandatoryType(exchange, String.class, inputStream);
Message message = HL7Converter.toMessage(body);
// add MSH fields as message out headers
Terser terser = new Terser(message);
exchange.getOut().setHeader(HL7Constants.HL7_SENDING_APPLICATION, terser.get("MSH-3"));
exchange.getOut().setHeader(HL7Constants.HL7_SENDING_FACILITY, terser.get("MSH-4"));