All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.yamcs.utils.ActiveMQBufferOutputStream Maven / Gradle / Ivy

There is a newer version: 4.10.9
Show newest version
package org.yamcs.utils;

import java.io.IOException;
import java.io.OutputStream;

import org.apache.activemq.artemis.api.core.ActiveMQBuffer;

/**
 * OutputStream that writes into an ActiveMQBuffer
 * @author nm
 *
 */
public class ActiveMQBufferOutputStream extends OutputStream {
    private final ActiveMQBuffer hqb;

    public ActiveMQBufferOutputStream(ActiveMQBuffer out) { 
	this.hqb = out;
    }

    @Override
    public void write(int b) throws IOException {
	hqb.writeByte((byte)(b & 0xff));
    }

    @Override
    public void write (byte[] src, int offset, int length) throws IOException {
	hqb.writeBytes(src, offset, length);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy