Home / Function/ encode3to4BigEndian() — netty Function Reference

encode3to4BigEndian() — netty Function Reference

Architecture documentation for the encode3to4BigEndian() function in Base64.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  17882ff8_ea90_bf2d_118f_81fad4d75770["encode3to4BigEndian()"]
  185f00a4_bc52_6a3f_9287_a20b3809bf29["Base64"]
  17882ff8_ea90_bf2d_118f_81fad4d75770 -->|defined in| 185f00a4_bc52_6a3f_9287_a20b3809bf29
  7551fd15_5173_2a99_6a2e_fbfda3e91ed1["encode3to4()"]
  7551fd15_5173_2a99_6a2e_fbfda3e91ed1 -->|calls| 17882ff8_ea90_bf2d_118f_81fad4d75770
  style 17882ff8_ea90_bf2d_118f_81fad4d75770 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-base/src/main/java/io/netty/handler/codec/base64/Base64.java lines 255–294

    private static int encode3to4BigEndian(
            int inBuff, int numSigBytes, ByteBuf dest, int destOffset, byte[] alphabet, boolean addPadding) {
        // Packing bytes into an int to reduce bound and reference count checking.
        switch (numSigBytes) {
            case 3:
                dest.setInt(destOffset, alphabet[inBuff >>> 18       ] << 24 |
                                        alphabet[inBuff >>> 12 & 0x3f] << 16 |
                                        alphabet[inBuff >>>  6 & 0x3f] << 8  |
                                        alphabet[inBuff        & 0x3f]);
                return 4;
            case 2:
                if (addPadding) {
                    dest.setInt(destOffset, alphabet[inBuff >>> 18       ] << 24 |
                                            alphabet[inBuff >>> 12 & 0x3f] << 16 |
                                            alphabet[inBuff >>> 6  & 0x3f] << 8  |
                                            EQUALS_SIGN);
                    return 4;
                } else {
                    dest.setMedium(destOffset, alphabet[inBuff >>> 18       ] << 16 |
                                               alphabet[inBuff >>> 12 & 0x3f] << 8  |
                                               alphabet[inBuff >>> 6 & 0x3f ]);
                    return 3;
                }
            case 1:
                if (addPadding) {
                    dest.setInt(destOffset, alphabet[inBuff >>> 18       ] << 24 |
                                            alphabet[inBuff >>> 12 & 0x3f] << 16 |
                                            EQUALS_SIGN                    << 8  |
                                            EQUALS_SIGN);
                    return 4;
                } else {
                    dest.setShort(destOffset, alphabet[inBuff >>> 18       ] << 8 |
                                              alphabet[inBuff >>> 12 & 0x3f]);
                    return 2;
                }
            default:
                // NOOP
                return 0;
        }
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does encode3to4BigEndian() do?
encode3to4BigEndian() is a function in the netty codebase, defined in codec-base/src/main/java/io/netty/handler/codec/base64/Base64.java.
Where is encode3to4BigEndian() defined?
encode3to4BigEndian() is defined in codec-base/src/main/java/io/netty/handler/codec/base64/Base64.java at line 255.
What calls encode3to4BigEndian()?
encode3to4BigEndian() is called by 1 function(s): encode3to4.

Analyze Your Own Codebase

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

Try Supermodel Free