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

org.mockserver.codec.MockServerBinaryToNettyBinaryRequestEncoder Maven / Gradle / Ivy

There is a newer version: 5.15.0
Show newest version
package org.mockserver.codec;

import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageEncoder;
import org.mockserver.model.BinaryMessage;

import java.util.List;

public class MockServerBinaryToNettyBinaryRequestEncoder extends MessageToMessageEncoder {
    @Override
    protected void encode(ChannelHandlerContext ctx, BinaryMessage binaryMessage, List out) {
        out.add(Unpooled.copiedBuffer(binaryMessage.getBytes()));
    }
}