Home / Class/ MessageDecoder Class — netty Architecture

MessageDecoder Class — netty Architecture

Architecture documentation for the MessageDecoder class in FileRegionThrottleTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  56346a7e_a908_7496_0b6a_970d1ea1ee3f["MessageDecoder"]
  b1d8c2e8_da00_2332_3992_4ef5b12182b7["FileRegionThrottleTest.java"]
  56346a7e_a908_7496_0b6a_970d1ea1ee3f -->|defined in| b1d8c2e8_da00_2332_3992_4ef5b12182b7
  2bf79126_3b79_ceb6_67bc_f8298ff0619c["channelRead()"]
  56346a7e_a908_7496_0b6a_970d1ea1ee3f -->|method| 2bf79126_3b79_ceb6_67bc_f8298ff0619c

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/traffic/FileRegionThrottleTest.java lines 124–137

    private static final class MessageDecoder extends ChannelInboundHandlerAdapter {
        @Override
        public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
            if (msg instanceof ByteBuf) {
                ByteBuf buf = (ByteBuf) msg;
                String message = buf.toString(Charset.defaultCharset());
                buf.release();
                if (message.equals("send-file")) {
                    RandomAccessFile raf = new RandomAccessFile(tmp, "r");
                    ctx.channel().writeAndFlush(new DefaultFileRegion(raf.getChannel(), 0, tmp.length()));
                }
            }
        }
    }

Frequently Asked Questions

What is the MessageDecoder class?
MessageDecoder is a class in the netty codebase, defined in handler/src/test/java/io/netty/handler/traffic/FileRegionThrottleTest.java.
Where is MessageDecoder defined?
MessageDecoder is defined in handler/src/test/java/io/netty/handler/traffic/FileRegionThrottleTest.java at line 124.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free