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

de.codecentric.mule.assertobjectequals.ByteArrayBasedOutputHandler Maven / Gradle / Ivy

The newest version!
package de.codecentric.mule.assertobjectequals;

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

import org.mule.api.MuleEvent;
import org.mule.api.transport.OutputHandler;

/**
 * {@link OutputHandler} backed by a byte[].
 */
public class ByteArrayBasedOutputHandler implements OutputHandler {
    private byte[] data;

    /**
     * @param data
     *            Content, will be copied.
     */
    public ByteArrayBasedOutputHandler(byte[] data) {
        this.data = data.clone();
    }

    @Override
    public void write(MuleEvent event, OutputStream out) throws IOException {
        out.write(data);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy