Home / Function/ findMatchingLength() — netty Function Reference

findMatchingLength() — netty Function Reference

Architecture documentation for the findMatchingLength() function in Snappy.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  70d7f600_24fa_537e_e58f_7a425608478d["findMatchingLength()"]
  6a7984ff_ded6_5ba2_b4bb_f92d0d3986f8["Snappy"]
  70d7f600_24fa_537e_e58f_7a425608478d -->|defined in| 6a7984ff_ded6_5ba2_b4bb_f92d0d3986f8
  2c81d28d_4011_0232_9bac_669b46d6eed3["encode()"]
  2c81d28d_4011_0232_9bac_669b46d6eed3 -->|calls| 70d7f600_24fa_537e_e58f_7a425608478d
  style 70d7f600_24fa_537e_e58f_7a425608478d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-compression/src/main/java/io/netty/handler/codec/compression/Snappy.java lines 224–239

    private static int findMatchingLength(ByteBuf in, int minIndex, int inIndex, int maxIndex) {
        int matched = 0;

        while (inIndex <= maxIndex - 4 &&
                in.getInt(inIndex) == in.getInt(minIndex + matched)) {
            inIndex += 4;
            matched += 4;
        }

        while (inIndex < maxIndex && in.getByte(minIndex + matched) == in.getByte(inIndex)) {
            ++inIndex;
            ++matched;
        }

        return matched;
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does findMatchingLength() do?
findMatchingLength() is a function in the netty codebase, defined in codec-compression/src/main/java/io/netty/handler/codec/compression/Snappy.java.
Where is findMatchingLength() defined?
findMatchingLength() is defined in codec-compression/src/main/java/io/netty/handler/codec/compression/Snappy.java at line 224.
What calls findMatchingLength()?
findMatchingLength() is called by 1 function(s): encode.

Analyze Your Own Codebase

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

Try Supermodel Free