Home / Class/ TestCertCompressionAlgo Class — netty Architecture

TestCertCompressionAlgo Class — netty Architecture

Architecture documentation for the TestCertCompressionAlgo class in OpenSslCertificateCompressionTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  d257dd55_cb14_ccc7_47ca_4959e1708358["TestCertCompressionAlgo"]
  d25c0995_133b_eb64_125b_b43330550916["OpenSslCertificateCompressionTest.java"]
  d257dd55_cb14_ccc7_47ca_4959e1708358 -->|defined in| d25c0995_133b_eb64_125b_b43330550916
  1ab75f05_fd84_ce7a_c9ce_51fc72288eee["TestCertCompressionAlgo()"]
  d257dd55_cb14_ccc7_47ca_4959e1708358 -->|method| 1ab75f05_fd84_ce7a_c9ce_51fc72288eee
  7beacc2c_8ad6_c029_5eb4_5cb4f359067d["compress()"]
  d257dd55_cb14_ccc7_47ca_4959e1708358 -->|method| 7beacc2c_8ad6_c029_5eb4_5cb4f359067d
  fab5e1f6_2020_0492_51a7_c6b362aa47ac["decompress()"]
  d257dd55_cb14_ccc7_47ca_4959e1708358 -->|method| fab5e1f6_2020_0492_51a7_c6b362aa47ac
  d5adf991_c972_f265_87e8_dbab5398a0f0["algorithmId()"]
  d257dd55_cb14_ccc7_47ca_4959e1708358 -->|method| d5adf991_c972_f265_87e8_dbab5398a0f0

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/OpenSslCertificateCompressionTest.java lines 413–444

    private static class TestCertCompressionAlgo implements OpenSslCertificateCompressionAlgorithm {

        private static final int BASE_PADDING_SIZE = 10;
        public boolean compressCalled;
        public boolean decompressCalled;
        private final int algorithmId;

        TestCertCompressionAlgo(int algorithmId) {
            this.algorithmId = algorithmId;
        }

        @Override
        public byte[] compress(SSLEngine engine, byte[] input) throws Exception {
            compressCalled = true;
            byte[] output = new byte[input.length + BASE_PADDING_SIZE + algorithmId];
            System.arraycopy(input, 0, output, BASE_PADDING_SIZE + algorithmId, input.length);
            return output;
        }

        @Override
        public byte[] decompress(SSLEngine engine, int uncompressed_len, byte[] input) {
            decompressCalled = true;
            byte[] output = new byte[input.length - (BASE_PADDING_SIZE + algorithmId)];
            System.arraycopy(input, BASE_PADDING_SIZE + algorithmId, output, 0, output.length);
            return output;
        }

        @Override
        public int algorithmId() {
            return algorithmId;
        }
    }

Frequently Asked Questions

What is the TestCertCompressionAlgo class?
TestCertCompressionAlgo is a class in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/OpenSslCertificateCompressionTest.java.
Where is TestCertCompressionAlgo defined?
TestCertCompressionAlgo is defined in handler/src/test/java/io/netty/handler/ssl/OpenSslCertificateCompressionTest.java at line 413.

Analyze Your Own Codebase

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

Try Supermodel Free