Home / Class/ Indices Class — netty Architecture

Indices Class — netty Architecture

Architecture documentation for the Indices class in QpackEncoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  852088f4_0263_62b5_8e4d_5ed69d223709["Indices"]
  a9d0b375_1921_29ff_f601_0a8b3ca33ae0["QpackEncoder.java"]
  852088f4_0263_62b5_8e4d_5ed69d223709 -->|defined in| a9d0b375_1921_29ff_f601_0a8b3ca33ae0
  a8642bed_b3de_8bb7_a79f_f18b39f7cc89["add()"]
  852088f4_0263_62b5_8e4d_5ed69d223709 -->|method| a8642bed_b3de_8bb7_a79f_f18b39f7cc89
  70504f22_8dde_e329_ac4d_a33cfef182b5["forEach()"]
  852088f4_0263_62b5_8e4d_5ed69d223709 -->|method| 70504f22_8dde_e329_ac4d_a33cfef182b5

Relationship Graph

Source Code

codec-http3/src/main/java/io/netty/handler/codec/http3/QpackEncoder.java lines 520–543

    private static final class Indices {
        private int idx;
        // Let's just assume 4 indices for now that we will store here as max.
        private int[] array = new int[4];

        void add(int index) {
            if (idx == array.length) {
                // Double it if needed.
                array = Arrays.copyOf(array, array.length << 1);
            }
            array[idx++] = index;
        }

        void forEach(IndexConsumer consumer) throws QpackException {
            for (int i = 0; i < idx; i++) {
                consumer.accept(array[i]);
            }
        }

        @FunctionalInterface
        interface IndexConsumer {
            void accept(int idx) throws QpackException;
        }
    }

Frequently Asked Questions

What is the Indices class?
Indices is a class in the netty codebase, defined in codec-http3/src/main/java/io/netty/handler/codec/http3/QpackEncoder.java.
Where is Indices defined?
Indices is defined in codec-http3/src/main/java/io/netty/handler/codec/http3/QpackEncoder.java at line 520.

Analyze Your Own Codebase

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

Try Supermodel Free