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

org.jboss.ejb.protocol.remote.NoFlushByteOutput Maven / Gradle / Ivy

Go to download

Client library for EJB applications working against Wildfly - Jakarta EE Variant

There is a newer version: 5.0.8.Final
Show newest version
package org.jboss.ejb.protocol.remote;

import java.io.IOException;

import org.jboss.marshalling.ByteOutput;

/**
 * An output stream that ignores flushes. The marshsaller will flush when it is done, which
 * results in two frames on the wire. By ignoring the flush only one frame is sent for
 * each message.
 *
 * @author Stuart Douglas
 */
class NoFlushByteOutput implements ByteOutput {

    private final ByteOutput delegate;

    NoFlushByteOutput(ByteOutput delegate) {
        this.delegate = delegate;
    }

    @Override
    public void write(int b) throws IOException {
        delegate.write(b);
    }

    @Override
    public void write(byte[] b) throws IOException {
        delegate.write(b);
    }

    @Override
    public void write(byte[] b, int off, int len) throws IOException {
        delegate.write(b, off, len);
    }

    @Override
    public void close() throws IOException {
        delegate.close();
    }

    @Override
    public void flush() throws IOException {
        //ignore
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy