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

io.vertx.core.eventbus.EnvelopCodec Maven / Gradle / Ivy

There is a newer version: 0.9.0
Show newest version
package io.vertx.core.eventbus;

import io.vertx.core.buffer.Buffer;
import io.vertx.up.commune.Envelop;
import io.vertx.up.eon.Values;
import io.vertx.up.util.Ut;

/**
 * Codec to transfer envelop
 */
public final class EnvelopCodec implements MessageCodec {

    @Override
    public void encodeToWire(final Buffer buffer,
                             final Envelop message) {
        buffer.appendBytes(Ut.toBytes(message));
    }

    @Override
    public Envelop decodeFromWire(final int i,
                                  final Buffer buffer) {
        return Ut.fromBuffer(i, buffer);
    }

    @Override
    public Envelop transform(final Envelop message) {
        return message;
    }

    @Override
    public String name() {
        return this.getClass().getName();
    }

    @Override
    public byte systemCodecID() {
        return Values.CODECS;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy