Home / Function/ size() — netty Function Reference

size() — netty Function Reference

Architecture documentation for the size() function in DefaultMessageSizeEstimator.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  840cc53a_856b_52f0_c731_100c504032db["size()"]
  dbfdcb5b_d495_91bf_c683_cf2f179e76e9["HandleImpl"]
  840cc53a_856b_52f0_c731_100c504032db -->|defined in| dbfdcb5b_d495_91bf_c683_cf2f179e76e9
  style 840cc53a_856b_52f0_c731_100c504032db fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/DefaultMessageSizeEstimator.java lines 36–48

        @Override
        public int size(Object msg) {
            if (msg instanceof ByteBuf) {
                return ((ByteBuf) msg).readableBytes();
            }
            if (msg instanceof ByteBufHolder) {
                return ((ByteBufHolder) msg).content().readableBytes();
            }
            if (msg instanceof FileRegion) {
                return 0;
            }
            return unknownSize;
        }

Domain

Subdomains

Frequently Asked Questions

What does size() do?
size() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/DefaultMessageSizeEstimator.java.
Where is size() defined?
size() is defined in transport/src/main/java/io/netty/channel/DefaultMessageSizeEstimator.java at line 36.

Analyze Your Own Codebase

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

Try Supermodel Free