Home / Function/ testIsTextWithUtf8() — netty Function Reference

testIsTextWithUtf8() — netty Function Reference

Architecture documentation for the testIsTextWithUtf8() function in ByteBufUtilTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  4ab6f6ce_2bfb_3bdb_7e14_c12571b0f895["testIsTextWithUtf8()"]
  1b32157c_4c5c_4c3c_706b_1a74a9afdca7["ByteBufUtilTest"]
  4ab6f6ce_2bfb_3bdb_7e14_c12571b0f895 -->|defined in| 1b32157c_4c5c_4c3c_706b_1a74a9afdca7
  341f55f8_87ae_50af_6d34_d1c23e9ddf4c["assertIsText()"]
  4ab6f6ce_2bfb_3bdb_7e14_c12571b0f895 -->|calls| 341f55f8_87ae_50af_6d34_d1c23e9ddf4c
  style 4ab6f6ce_2bfb_3bdb_7e14_c12571b0f895 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/ByteBufUtilTest.java lines 857–890

    @ParameterizedTest(name = PARAMETERIZED_NAME)
    @MethodSource("noUnsafe")
    public void testIsTextWithUtf8(BufferType bufferType) {
        byte[][] validUtf8Bytes = {
                "netty".getBytes(CharsetUtil.UTF_8),
                {(byte) 0x24},
                {(byte) 0xC2, (byte) 0xA2},
                {(byte) 0xE2, (byte) 0x82, (byte) 0xAC},
                {(byte) 0xF0, (byte) 0x90, (byte) 0x8D, (byte) 0x88},
                {(byte) 0x24,
                        (byte) 0xC2, (byte) 0xA2,
                        (byte) 0xE2, (byte) 0x82, (byte) 0xAC,
                        (byte) 0xF0, (byte) 0x90, (byte) 0x8D, (byte) 0x88} // multiple characters
        };
        for (byte[] bytes : validUtf8Bytes) {
            assertIsText(bufferType, bytes, true, CharsetUtil.UTF_8);
        }
        byte[][] invalidUtf8Bytes = {
                {(byte) 0x80},
                {(byte) 0xF0, (byte) 0x82, (byte) 0x82, (byte) 0xAC}, // Overlong encodings
                {(byte) 0xC2},                                        // not enough bytes
                {(byte) 0xE2, (byte) 0x82},                           // not enough bytes
                {(byte) 0xF0, (byte) 0x90, (byte) 0x8D},              // not enough bytes
                {(byte) 0xC2, (byte) 0xC0},                           // not correct bytes
                {(byte) 0xE2, (byte) 0x82, (byte) 0xC0},              // not correct bytes
                {(byte) 0xF0, (byte) 0x90, (byte) 0x8D, (byte) 0xC0}, // not correct bytes
                {(byte) 0xC1, (byte) 0x80},                           // out of lower bound
                {(byte) 0xE0, (byte) 0x80, (byte) 0x80},              // out of lower bound
                {(byte) 0xED, (byte) 0xAF, (byte) 0x80}               // out of upper bound
        };
        for (byte[] bytes : invalidUtf8Bytes) {
            assertIsText(bufferType, bytes, false, CharsetUtil.UTF_8);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testIsTextWithUtf8() do?
testIsTextWithUtf8() is a function in the netty codebase, defined in buffer/src/test/java/io/netty/buffer/ByteBufUtilTest.java.
Where is testIsTextWithUtf8() defined?
testIsTextWithUtf8() is defined in buffer/src/test/java/io/netty/buffer/ByteBufUtilTest.java at line 857.
What does testIsTextWithUtf8() call?
testIsTextWithUtf8() calls 1 function(s): assertIsText.

Analyze Your Own Codebase

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

Try Supermodel Free