Package org.apache.activemq.util

Examples of org.apache.activemq.util.ByteSequence.compact()


        resultEndpoint.assertIsSatisfied();

        List<Exchange> list = resultEndpoint.getReceivedExchanges();
        Exchange exchange = list.get(0);
        ByteSequence body = (ByteSequence)exchange.getIn().getBody();
        body.compact(); // trims the byte array to the actual size.
        assertEquals("body", new String(payload), new String(body.data));
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
View Full Code Here


        EntityManager manager = adapter.beginEntityManager(context);
        try {

            ByteSequence sequence = wireFormat.marshal(message);
            sequence.compact();

            StoredMessage sm = new StoredMessage();
            sm.setDestination(destinationName);
            sm.setId(message.getMessageId().getBrokerSequenceId());
            sm.setMessageId(message.getMessageId().toString());
View Full Code Here

        resultEndpoint.assertIsSatisfied();

        List<Exchange> list = resultEndpoint.getReceivedExchanges();
        Exchange exchange = list.get(0);
        ByteSequence body = (ByteSequence)exchange.getIn().getBody();
        body.compact(); // trims the byte array to the actual size.
        assertEquals("body", new String(payload), new String(body.data));
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
View Full Code Here

        resultEndpoint.assertIsSatisfied();

        List<Exchange> list = resultEndpoint.getReceivedExchanges();
        Exchange exchange = list.get(0);
        ByteSequence body = (ByteSequence)exchange.getIn().getBody();
        body.compact(); // trims the byte array to the actual size.
        assertEquals("body", new String(payload), new String(body.data));
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
View Full Code Here

        resultEndpoint.assertIsSatisfied();

        List<Exchange> list = resultEndpoint.getReceivedExchanges();
        Exchange exchange = list.get(0);
        ByteSequence body = (ByteSequence)exchange.getIn().getBody();
        body.compact(); // trims the byte array to the actual size.
        assertEquals("body", new String(payload), new String(body.data));
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
View Full Code Here

            DataByteArrayOutputStream os = new DataByteArrayOutputStream();
            os.writeInt(BATCH_CONTROL_RECORD_SIZE);
            os.writeByte(BATCH_CONTROL_RECORD_TYPE);
            os.write(BATCH_CONTROL_RECORD_MAGIC);
            ByteSequence sequence = os.toByteSequence();
            sequence.compact();
            return sequence.getData();
        } catch (IOException e) {
            throw new RuntimeException("Could not create batch control record header.", e);
        }
    }
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.