Package org.apache.activemq.util

Examples of org.apache.activemq.util.ByteArrayInputStream


    @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

        if (this.dataIn == null) {
            ByteSequence data = getContent();
            if (data == null) {
                data = new ByteSequence(new byte[] {}, 0, 0);
            }
            InputStream is = new ByteArrayInputStream(data);
            if (isCompressed()) {
                is = new InflaterInputStream(is);
                is = new BufferedInputStream(is);
            }
            this.dataIn = new DataInputStream(is);
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

            }
        }
    }

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

     */
    private void loadContent() throws JMSException {
        try {
            if (getContent() != null && map.isEmpty()) {
                ByteSequence content = getContent();
                InputStream is = new ByteArrayInputStream(content);
                if (isCompressed()) {
                    is = new InflaterInputStream(is);
                }
                DataInputStream dataIn = new DataInputStream(is);
                map = MarshallingSupport.unmarshalPrimitiveMap(dataIn);
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

        PostMethod httpMethod = new PostMethod(getRemoteUrl().toString());
        configureMethod(httpMethod);
        String data = getTextWireFormat().marshalText(command);
        byte[] bytes = data.getBytes("UTF-8");
        httpMethod.setRequestBody(new ByteArrayInputStream(bytes));

        try {

            HttpClient client = getSendHttpClient();
            client.setTimeout(MAX_CLIENT_TIMEOUT);
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.