Home / Function/ writeRun() — netty Function Reference

writeRun() — netty Function Reference

Architecture documentation for the writeRun() function in Bzip2BlockCompressor.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  531fad03_b1f1_8ad1_160b_6f41129f0f30["writeRun()"]
  14ecc34c_1aa7_b25b_4492_69c298ece54c["Bzip2BlockCompressor"]
  531fad03_b1f1_8ad1_160b_6f41129f0f30 -->|defined in| 14ecc34c_1aa7_b25b_4492_69c298ece54c
  9c11989a_f32b_4f73_9dbc_19da6668a445["write()"]
  9c11989a_f32b_4f73_9dbc_19da6668a445 -->|calls| 531fad03_b1f1_8ad1_160b_6f41129f0f30
  7cbb1b2c_aece_4497_adec_be1cc44c8782["close()"]
  7cbb1b2c_aece_4497_adec_be1cc44c8782 -->|calls| 531fad03_b1f1_8ad1_160b_6f41129f0f30
  style 531fad03_b1f1_8ad1_160b_6f41129f0f30 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-compression/src/main/java/io/netty/handler/codec/compression/Bzip2BlockCompressor.java lines 141–176

    private void writeRun(final int value, int runLength) {
        final int blockLength = this.blockLength;
        final byte[] block = this.block;

        blockValuesPresent[value] = true;
        crc.updateCRC(value, runLength);

        final byte byteValue = (byte) value;
        switch (runLength) {
            case 1:
                block[blockLength] = byteValue;
                this.blockLength = blockLength + 1;
                break;
            case 2:
                block[blockLength] = byteValue;
                block[blockLength + 1] = byteValue;
                this.blockLength = blockLength + 2;
                break;
            case 3:
                block[blockLength] = byteValue;
                block[blockLength + 1] = byteValue;
                block[blockLength + 2] = byteValue;
                this.blockLength = blockLength + 3;
                break;
            default:
                runLength -= 4;
                blockValuesPresent[runLength] = true;
                block[blockLength] = byteValue;
                block[blockLength + 1] = byteValue;
                block[blockLength + 2] = byteValue;
                block[blockLength + 3] = byteValue;
                block[blockLength + 4] = (byte) runLength;
                this.blockLength = blockLength + 5;
                break;
        }
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does writeRun() do?
writeRun() is a function in the netty codebase, defined in codec-compression/src/main/java/io/netty/handler/codec/compression/Bzip2BlockCompressor.java.
Where is writeRun() defined?
writeRun() is defined in codec-compression/src/main/java/io/netty/handler/codec/compression/Bzip2BlockCompressor.java at line 141.
What calls writeRun()?
writeRun() is called by 2 function(s): close, write.

Analyze Your Own Codebase

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

Try Supermodel Free