Home / Function/ testSetContentFromInputStream() — netty Function Reference

testSetContentFromInputStream() — netty Function Reference

Architecture documentation for the testSetContentFromInputStream() function in DiskFileUploadTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  1c0f4b89_adc1_c0a4_f1bc_1c4c7cd91ae1["testSetContentFromInputStream()"]
  453c587b_ec9f_a761_a22b_ccf63aa13d1f["DiskFileUploadTest"]
  1c0f4b89_adc1_c0a4_f1bc_1c4c7cd91ae1 -->|defined in| 453c587b_ec9f_a761_a22b_ccf63aa13d1f
  ba93742e_e095_ec03_62ad_a5ac126c1d2d["doReadFile()"]
  1c0f4b89_adc1_c0a4_f1bc_1c4c7cd91ae1 -->|calls| ba93742e_e095_ec03_62ad_a5ac126c1d2d
  style 1c0f4b89_adc1_c0a4_f1bc_1c4c7cd91ae1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/multipart/DiskFileUploadTest.java lines 163–183

    @Test
    public void testSetContentFromInputStream() throws Exception {
        String json = "{\"hello\":\"world\",\"foo\":\"bar\"}";
        DiskFileUpload f1 = new DiskFileUpload("file3", "file3", "application/json", null, null, 0);
        try {
            byte[] bytes = json.getBytes(CharsetUtil.UTF_8);
            ByteBuf buf = Unpooled.wrappedBuffer(bytes);
            try (InputStream is = new ByteBufInputStream(buf)) {
                f1.setContent(is);
                assertEquals(json, f1.getString());
                assertArrayEquals(bytes, f1.get());
                File file = f1.getFile();
                assertEquals((long) bytes.length, file.length());
                assertArrayEquals(bytes, doReadFile(file, bytes.length));
            } finally {
                buf.release();
            }
        } finally {
            f1.delete();
        }
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does testSetContentFromInputStream() do?
testSetContentFromInputStream() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/multipart/DiskFileUploadTest.java.
Where is testSetContentFromInputStream() defined?
testSetContentFromInputStream() is defined in codec-http/src/test/java/io/netty/handler/codec/http/multipart/DiskFileUploadTest.java at line 163.
What does testSetContentFromInputStream() call?
testSetContentFromInputStream() calls 1 function(s): doReadFile.

Analyze Your Own Codebase

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

Try Supermodel Free