class BytesOutputPipe extends FixedForwardPipe {

	@Override
	public PipeRunResult doPipe(Message message, IPipeLineSession session) throws PipeRunException {
		Object result = null;

		try {
			FieldsContentHandler fieldsContentHandler = new FieldsContentHandler();
			XmlUtils.parseXml(message.asInputSource(), fieldsContentHandler);
			result = fieldsContentHandler.getResult();
		} catch (SAXException e) {
			throw new PipeRunException(this, "SAXException", e);
		} catch (IOException e) {
			throw new PipeRunException(this, "IOException", e);
		}
		return new PipeRunResult(getForward(), result);
	}

}