Example usage for io.netty.handler.codec UnsupportedMessageTypeException UnsupportedMessageTypeException

List of usage examples for io.netty.handler.codec UnsupportedMessageTypeException UnsupportedMessageTypeException

Introduction

In this page you can find the example usage for io.netty.handler.codec UnsupportedMessageTypeException UnsupportedMessageTypeException.

Prototype

public UnsupportedMessageTypeException() 

Source Link

Usage

From source file:de.felix_klauke.pegasus.protocol.decoder.PacketDecoder.java

License:Apache License

/**
 * This method will handle any incoming data. Neverminds about the type.
 *
 * @param channelHandlerContext the contect of the Channel the data comes from
 * @param byteBuf               the incoming data
 * @param list                  add all objects to continue to work with to this list
 * @throws Exception will be thrown when handling the data fails
 *//*from   w w w.  j av  a2  s  . co m*/
@Override
protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> list)
        throws Exception {
    if (byteBuf instanceof EmptyByteBuf)
        return;
    int packetID = byteBuf.readInt();

    if (packetID == -1) {
        throw new UnsupportedMessageTypeException();
    }
    Packet packet = PacketType.lookup(packetID);
    if (packet != null) {
        packet.decode(byteBuf);
        list.add(packet);
    }
}

From source file:io.vertx.core.http.impl.AssembledHttpRequest.java

License:Open Source License

@Override
public HttpContent retainedDuplicate() {
    throw new UnsupportedMessageTypeException();
}

From source file:io.vertx.core.http.impl.AssembledHttpRequest.java

License:Open Source License

@Override
public HttpContent replace(ByteBuf content) {
    throw new UnsupportedMessageTypeException();
}