Home / Function/ testWriteIp4ReadIpv6Mapped() — netty Function Reference

testWriteIp4ReadIpv6Mapped() — netty Function Reference

Architecture documentation for the testWriteIp4ReadIpv6Mapped() function in SockaddrInTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  8665082b_6c07_27b4_5d29_cd377b564330["testWriteIp4ReadIpv6Mapped()"]
  f542b96b_70a1_3930_b104_0cabb6a71e80["SockaddrInTest"]
  8665082b_6c07_27b4_5d29_cd377b564330 -->|defined in| f542b96b_70a1_3930_b104_0cabb6a71e80
  style 8665082b_6c07_27b4_5d29_cd377b564330 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-native-io_uring/src/test/java/io/netty/channel/uring/SockaddrInTest.java lines 81–102

    @Test
    public void testWriteIp4ReadIpv6Mapped() throws Exception {
        CleanableDirectBuffer cleanableDirectBuffer = allocateDirectBufferWithNativeOrder(64);
        ByteBuffer buffer = cleanableDirectBuffer.buffer();
        try {
            InetAddress address = InetAddress.getByAddress(new byte[] { 10, 10, 10, 10 });
            int port = 45678;
            assertEquals(Native.SIZEOF_SOCKADDR_IN6, SockaddrIn.setIPv6(buffer, address, port));
            byte[] ipv6Bytes = new byte[16];
            byte[] ipv4Bytes = new byte[4];

            InetSocketAddress sockAddr = SockaddrIn.getIPv6(buffer, ipv6Bytes, ipv4Bytes);
            Inet4Address ipv4Address = (Inet4Address) sockAddr.getAddress();

            System.arraycopy(SockaddrIn.IPV4_MAPPED_IPV6_PREFIX, 0, ipv6Bytes, 0,
                    SockaddrIn.IPV4_MAPPED_IPV6_PREFIX.length);
            assertArrayEquals(ipv4Bytes, ipv4Address.getAddress());
            assertEquals(port, sockAddr.getPort());
        } finally {
            cleanableDirectBuffer.clean();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testWriteIp4ReadIpv6Mapped() do?
testWriteIp4ReadIpv6Mapped() is a function in the netty codebase, defined in transport-native-io_uring/src/test/java/io/netty/channel/uring/SockaddrInTest.java.
Where is testWriteIp4ReadIpv6Mapped() defined?
testWriteIp4ReadIpv6Mapped() is defined in transport-native-io_uring/src/test/java/io/netty/channel/uring/SockaddrInTest.java at line 81.

Analyze Your Own Codebase

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

Try Supermodel Free