Home / Function/ padWithZeros() — netty Function Reference

padWithZeros() — netty Function Reference

Architecture documentation for the padWithZeros() function in DefaultDnsRecordEncoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  5999e8f6_ef45_7750_d4c1_7a23377b4abf["padWithZeros()"]
  7acd50be_5ea0_6375_ac42_d023d53b4027["DefaultDnsRecordEncoder"]
  5999e8f6_ef45_7750_d4c1_7a23377b4abf -->|defined in| 7acd50be_5ea0_6375_ac42_d023d53b4027
  e1aa726e_3571_f1cd_26ca_fe4a65acaf15["encodeOptEcsRecord()"]
  e1aa726e_3571_f1cd_26ca_fe4a65acaf15 -->|calls| 5999e8f6_ef45_7750_d4c1_7a23377b4abf
  style 5999e8f6_ef45_7750_d4c1_7a23377b4abf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-dns/src/main/java/io/netty/handler/codec/dns/DefaultDnsRecordEncoder.java lines 149–172

    private static byte padWithZeros(byte b, int lowOrderBitsToPreserve) {
        switch (lowOrderBitsToPreserve) {
        case 0:
            return 0;
        case 1:
            return (byte) (0x80 & b);
        case 2:
            return (byte) (0xC0 & b);
        case 3:
            return (byte) (0xE0 & b);
        case 4:
            return (byte) (0xF0 & b);
        case 5:
            return (byte) (0xF8 & b);
        case 6:
            return (byte) (0xFC & b);
        case 7:
            return (byte) (0xFE & b);
        case 8:
            return b;
        default:
            throw new IllegalArgumentException("lowOrderBitsToPreserve: " + lowOrderBitsToPreserve);
        }
    }

Subdomains

Frequently Asked Questions

What does padWithZeros() do?
padWithZeros() is a function in the netty codebase, defined in codec-dns/src/main/java/io/netty/handler/codec/dns/DefaultDnsRecordEncoder.java.
Where is padWithZeros() defined?
padWithZeros() is defined in codec-dns/src/main/java/io/netty/handler/codec/dns/DefaultDnsRecordEncoder.java at line 149.
What calls padWithZeros()?
padWithZeros() is called by 1 function(s): encodeOptEcsRecord.

Analyze Your Own Codebase

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

Try Supermodel Free