天道酬勤,学无止境

netty-socketio

How to chunk List<Object> in Netty

When sending file, you can do ctx.writeAndFlush(new ChunkedFile(new File("file.png")));. how about a List<Object>? The list contains String and bytes of image. from the documentation there's ChunkedInput() but I'm not able to get the use of it. UPDATE let's say in my Handler, inside channelRead0(ChannelHandlerContext ctx, Object o) method where I want to send the List<Object> I've done the following @Override protected void channelRead0(ChannelHandlerContext ctx, Object o) throws Exception { List<Object> msg = new ArrayList<>(); /**getting the bytes of image**/ byte[] imageInByte

2022-04-27 06:17:46    分类:问答    java   netty   netty-socketio