Examples of BytesSource


Examples of org.apache.camel.BytesSource

    }

    @Converter
    public static Serializable convertToSerializable(StreamCache cache, Exchange exchange) throws IOException {
        byte[] data = convertToByteArray(cache, exchange);
        return new BytesSource(data);
    }
View Full Code Here

Examples of org.apache.camel.BytesSource

        conv.toResult(null, null);
    }

    public void testToBytesSource() throws Exception {
        XmlConverter conv = new XmlConverter();
        BytesSource bs = conv.toBytesSource("<foo>bar</foo>".getBytes());
        assertNotNull(bs);
        assertEquals("<foo>bar</foo>", new String(bs.getData()));
    }
View Full Code Here

Examples of org.apache.camel.BytesSource

* @version
*/
public class BytesSourceTest extends ContextTestSupport {

    public void testBytesSourceCtr() {
        BytesSource bs = new BytesSource("foo".getBytes());
        assertNotNull(bs.getData());
        assertEquals("BytesSource[foo]", bs.toString());
        assertNull(bs.getSystemId());

        assertNotNull(bs.getInputStream());
        assertNotNull(bs.getReader());
    }
View Full Code Here

Examples of org.apache.camel.BytesSource

        assertNotNull(bs.getInputStream());
        assertNotNull(bs.getReader());
    }

    public void testBytesSourceCtrSystemId() {
        BytesSource bs = new BytesSource("foo".getBytes(), "Camel");
        assertNotNull(bs.getData());
        assertEquals("BytesSource[foo]", bs.toString());
        assertEquals("Camel", bs.getSystemId());

        assertNotNull(bs.getInputStream());
        assertNotNull(bs.getReader());
    }
View Full Code Here

Examples of org.apache.camel.BytesSource

    /**
     * Converts the given byte[] to a Source
     */
    @Converter
    public BytesSource toBytesSource(byte[] data) {
        return new BytesSource(data);
    }
View Full Code Here

Examples of org.apache.camel.BytesSource

        assertBuyStocks(result);
    }

    @Test
    public void toXmlObjectFromSource() throws IOException, XmlException, NoTypeConversionAvailableException {
        XmlObject result = XmlBeansConverter.toXmlObject(new BytesSource(PAYLOAD.getBytes()), new DefaultExchange(new DefaultCamelContext()));
        assertBuyStocks(result);
    }
View Full Code Here

Examples of org.apache.camel.BytesSource

    public Object evaluateAsBytesSource(Exchange exchange) throws Exception {
        LOG.debug("evaluateAsBytesSource: {} for exchange: {}", expression, exchange);
        initialize(exchange);

        byte[] bytes = evaluateAsBytes(exchange);
        return new BytesSource(bytes);
    }
View Full Code Here

Examples of org.apache.camel.BytesSource

    /**
     * Converts the given byte[] to a Source
     */
    @Converter
    public BytesSource toBytesSource(byte[] data) {
        return new BytesSource(data);
    }
View Full Code Here

Examples of org.apache.camel.BytesSource

    public Object evaluateAsBytesSource(Exchange exchange) throws Exception {
        initialize(exchange);

        byte[] bytes = evaluateAsBytes(exchange);
        return new BytesSource(bytes);
    }
View Full Code Here

Examples of org.apache.camel.converter.jaxp.BytesSource

    public Object evaluateAsBytesSource(Exchange exchange) throws Exception {
        initialize(exchange);

        byte[] bytes = evaluateAsBytes(exchange);
        return new BytesSource(bytes);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.