Package org.apache.activemq.util

Examples of org.apache.activemq.util.ByteArrayInputStream


        dos.close();
        return baos.toByteSequence();
    }

    public Object unmarshal(ByteSequence packet) throws IOException {
        ByteArrayInputStream stream = new ByteArrayInputStream(packet);
        DataInputStream dis = new DataInputStream(stream);
        return unmarshal(dis);
    }
View Full Code Here


                // TODO could use a DataInput implementation that talks direct
                // to
                // the ByteBuffer to avoid object allocation and unnecessary
                // buffering?
                DataInputStream dataIn = new DataInputStream(new ByteArrayInputStream(data));
                answer = (Command)wireFormat.unmarshal(dataIn);
                break;
            }
        }
        if (answer != null) {
View Full Code Here

                DatagramPacket datagram = createDatagramPacket();
                channel.receive(datagram);

                // TODO could use a DataInput implementation that talks direct
                // to the byte[] to avoid object allocation
                DataInputStream dataIn = new DataInputStream(new ByteArrayInputStream(datagram.getData()));

                from = headerMarshaller.createEndpoint(datagram, dataIn);
                answer = (Command)wireFormat.unmarshal(dataIn);
                break;
            }
View Full Code Here

    }

    private boolean evaluate(byte[] data) {
        try {

            InputSource inputSource = new InputSource(new ByteArrayInputStream(data));

            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            factory.setNamespaceAware(true);
            DocumentBuilder dbuilder = factory.newDocumentBuilder();
            Document doc = dbuilder.parse(inputSource);
View Full Code Here

        if (text == null && getContent() != null) {
            InputStream is = null;
            try {
                ByteSequence bodyAsBytes = getContent();
                if (bodyAsBytes != null) {
                    is = new ByteArrayInputStream(bodyAsBytes);
                    if (isCompressed()) {
                        is = new InflaterInputStream(is);
                    }
                    DataInputStream dataIn = new DataInputStream(is);
                    text = MarshallingSupport.readUTF8(dataIn);
View Full Code Here

            }
        }
    }

    private Map<String, Object> unmarsallProperties(ByteSequence marshalledProperties) throws IOException {
        return MarshallingSupport.unmarshalPrimitiveMap(new DataInputStream(new ByteArrayInputStream(marshalledProperties)));
    }
View Full Code Here

     */
    public Serializable getObject() throws JMSException {
        if (object == null && getContent() != null) {
            try {
                ByteSequence content = getContent();
                InputStream is = new ByteArrayInputStream(content);
                if (isCompressed()) {
                    is = new InflaterInputStream(is);
                }
                DataInputStream dataIn = new DataInputStream(is);
                ClassLoadingAwareObjectInputStream objIn = new ClassLoadingAwareObjectInputStream(dataIn);
View Full Code Here

    @Test
    public void testLogFile() throws Exception {
        FileSystem fs = dfsCluster.getFileSystem();
        OutputStream out = fs.create(logFile);
        InputStream in = new ByteArrayInputStream(
                ("instancePaths=/falcon/feed/agg-logs/path1/2010/10/10/20,"
                        + "/falcon/feed/agg-logs/path1/2010/10/10/21,"
                        + "/falcon/feed/agg-logs/path1/2010/10/10/22,"
                        + "/falcon/feed/agg-logs/path1/2010/10/10/23")
                        .getBytes());
View Full Code Here

    @Test
    public void testEmptyLogFile() throws Exception {
        FileSystem fs = dfsCluster.getFileSystem();
        OutputStream out = fs.create(logFile);
        InputStream in = new ByteArrayInputStream(("instancePaths=").getBytes());
        IOUtils.copyBytes(in, out, conf);

        new MessageProducer().run(this.args);
    }
View Full Code Here

        dos.close();
        return baos.toByteSequence();
    }

    public Object unmarshal(ByteSequence packet) throws IOException {
        ByteArrayInputStream stream = new ByteArrayInputStream(packet);
        DataInputStream dis = new DataInputStream(stream);
        return unmarshal(dis);
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.util.ByteArrayInputStream

Copyright © 2018 www.massapicom. 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.