protected Object decode(
            @SuppressWarnings("UnusedParameters") ChannelHandlerContext ctx, ByteBuf in) throws Exception {
        if (in.readableBytes() < frameLength) {
            return null;
        } else {
            return in.readRetainedSlice(frameLength);
        }
    }
protected Object decode ( @ SuppressWarnings ( "UnusedParameters" ) ChannelHandlerContext ctx , ByteBuf in ) throws Exception { if ( in . readableBytes ( ) < frameLength ) { return null ; } else { return in . readRetainedSlice ( frameLength ) ; } }
Create a frame out of the {@link ByteBuf} and return it.

@param   ctx             the {@link ChannelHandlerContext} which this {@link ByteToMessageDecoder} belongs to
@param   in              the {@link ByteBuf} from which to read data
@return  frame           the {@link ByteBuf} which represent the frame or {@code null} if no frame could
be created.