Home / Function/ readFrom() — netty Function Reference

readFrom() — netty Function Reference

Architecture documentation for the readFrom() function in AbstractDiskHttpData.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  f2399ca6_0b67_2eda_ec85_f7894af89210["readFrom()"]
  a3bc8afe_67a4_7958_deb1_2411299eac70["AbstractDiskHttpData"]
  f2399ca6_0b67_2eda_ec85_f7894af89210 -->|defined in| a3bc8afe_67a4_7958_deb1_2411299eac70
  0b383c44_ee98_923d_9548_a2b7f6fa16ca["get()"]
  0b383c44_ee98_923d_9548_a2b7f6fa16ca -->|calls| f2399ca6_0b67_2eda_ec85_f7894af89210
  dd334ef0_bddc_96a8_e369_3a4165595501["ByteBuf()"]
  dd334ef0_bddc_96a8_e369_3a4165595501 -->|calls| f2399ca6_0b67_2eda_ec85_f7894af89210
  78c06a73_91a2_18dc_5e35_86d66dbb0749["String()"]
  78c06a73_91a2_18dc_5e35_86d66dbb0749 -->|calls| f2399ca6_0b67_2eda_ec85_f7894af89210
  style f2399ca6_0b67_2eda_ec85_f7894af89210 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java lines 449–468

    private static byte[] readFrom(File src) throws IOException {
        long srcsize = src.length();
        if (srcsize > Integer.MAX_VALUE) {
            throw new IllegalArgumentException(
                    "File too big to be loaded in memory");
        }
        RandomAccessFile accessFile = new RandomAccessFile(src, "r");
        byte[] array = new byte[(int) srcsize];
        try {
            FileChannel fileChannel = accessFile.getChannel();
            ByteBuffer byteBuffer = ByteBuffer.wrap(array);
            int read = 0;
            while (read < srcsize) {
                read += fileChannel.read(byteBuffer);
            }
        } finally {
            accessFile.close();
        }
        return array;
    }

Subdomains

Frequently Asked Questions

What does readFrom() do?
readFrom() is a function in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java.
Where is readFrom() defined?
readFrom() is defined in codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java at line 449.
What calls readFrom()?
readFrom() is called by 3 function(s): ByteBuf, String, get.

Analyze Your Own Codebase

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

Try Supermodel Free