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

org.yamcs.http.HttpContentToByteBufDecoder Maven / Gradle / Ivy

There is a newer version: 5.10.9
Show newest version
package org.yamcs.http;

import java.util.List;


import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageDecoder;
import io.netty.handler.codec.http.HttpContent;

public class HttpContentToByteBufDecoder extends MessageToMessageDecoder{
    @Override
    protected void decode(ChannelHandlerContext ctx, HttpContent msg, List out) throws Exception {
        ByteBuf buf = msg.content();
        out.add(buf.retain());
    }
}