close() — netty Function Reference
Architecture documentation for the close() function in Bzip2BlockCompressor.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 7cbb1b2c_aece_4497_adec_be1cc44c8782["close()"] 14ecc34c_1aa7_b25b_4492_69c298ece54c["Bzip2BlockCompressor"] 7cbb1b2c_aece_4497_adec_be1cc44c8782 -->|defined in| 14ecc34c_1aa7_b25b_4492_69c298ece54c e8b3e716_b5f2_37ba_914c_38a5b70587b6["Bzip2BlockCompressor()"] e8b3e716_b5f2_37ba_914c_38a5b70587b6 -->|calls| 7cbb1b2c_aece_4497_adec_be1cc44c8782 531fad03_b1f1_8ad1_160b_6f41129f0f30["writeRun()"] 7cbb1b2c_aece_4497_adec_be1cc44c8782 -->|calls| 531fad03_b1f1_8ad1_160b_6f41129f0f30 ddf1fea8_2bb0_574e_9ec5_c760c5648da3["writeSymbolMap()"] 7cbb1b2c_aece_4497_adec_be1cc44c8782 -->|calls| ddf1fea8_2bb0_574e_9ec5_c760c5648da3 style 7cbb1b2c_aece_4497_adec_be1cc44c8782 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-compression/src/main/java/io/netty/handler/codec/compression/Bzip2BlockCompressor.java lines 225–262
void close(ByteBuf out) {
// If an RLE run is in progress, write it out
if (rleLength > 0) {
writeRun(rleCurrentValue & 0xff, rleLength);
}
// Apply a one byte block wrap required by the BWT implementation
block[blockLength] = block[0];
// Perform the Burrows Wheeler Transform
Bzip2DivSufSort divSufSort = new Bzip2DivSufSort(block, bwtBlock, blockLength);
int bwtStartPointer = divSufSort.bwt();
Bzip2BitWriter writer = this.writer;
// Write out the block header
writer.writeBits(out, 24, BLOCK_HEADER_MAGIC_1);
writer.writeBits(out, 24, BLOCK_HEADER_MAGIC_2);
writer.writeInt(out, crc.getCRC());
writer.writeBoolean(out, false); // Randomised block flag. We never create randomised blocks
writer.writeBits(out, 24, bwtStartPointer);
// Write out the symbol map
writeSymbolMap(out);
// Perform the Move To Front Transform and Run-Length Encoding[2] stages
Bzip2MTFAndRLE2StageEncoder mtfEncoder = new Bzip2MTFAndRLE2StageEncoder(bwtBlock, blockLength,
blockValuesPresent);
mtfEncoder.encode();
// Perform the Huffman Encoding stage and write out the encoded data
Bzip2HuffmanStageEncoder huffmanEncoder = new Bzip2HuffmanStageEncoder(writer,
mtfEncoder.mtfBlock(),
mtfEncoder.mtfLength(),
mtfEncoder.mtfAlphabetSize(),
mtfEncoder.mtfSymbolFrequencies());
huffmanEncoder.encode(out);
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does close() do?
close() is a function in the netty codebase, defined in codec-compression/src/main/java/io/netty/handler/codec/compression/Bzip2BlockCompressor.java.
Where is close() defined?
close() is defined in codec-compression/src/main/java/io/netty/handler/codec/compression/Bzip2BlockCompressor.java at line 225.
What does close() call?
close() calls 2 function(s): writeRun, writeSymbolMap.
What calls close()?
close() is called by 1 function(s): Bzip2BlockCompressor.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free