Bzip2EncoderTest Class — netty Architecture
Architecture documentation for the Bzip2EncoderTest class in Bzip2EncoderTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 002913a8_b807_e35a_3fcd_63568dbb8146["Bzip2EncoderTest"] 52e156dd_ef32_f923_5020_cb67ebb36602["Bzip2EncoderTest.java"] 002913a8_b807_e35a_3fcd_63568dbb8146 -->|defined in| 52e156dd_ef32_f923_5020_cb67ebb36602 2eb23347_165d_a8a0_a9c6_b18c7aaea5b0["EmbeddedChannel()"] 002913a8_b807_e35a_3fcd_63568dbb8146 -->|method| 2eb23347_165d_a8a0_a9c6_b18c7aaea5b0 e41cb9e9_1f04_09fc_b7d5_e34fcbdeeff9["ByteBuf()"] 002913a8_b807_e35a_3fcd_63568dbb8146 -->|method| e41cb9e9_1f04_09fc_b7d5_e34fcbdeeff9
Relationship Graph
Source Code
codec-compression/src/test/java/io/netty/handler/codec/compression/Bzip2EncoderTest.java lines 29–57
public class Bzip2EncoderTest extends AbstractEncoderTest {
@Override
protected EmbeddedChannel createChannel() {
return new EmbeddedChannel(new Bzip2Encoder(MIN_BLOCK_SIZE));
}
@Override
protected ByteBuf decompress(ByteBuf compressed, int originalLength) throws Exception {
byte[] decompressed = new byte[originalLength];
try (InputStream is = new ByteBufInputStream(compressed, true);
BZip2CompressorInputStream bzip2Is = new BZip2CompressorInputStream(is)) {
int remaining = originalLength;
while (remaining > 0) {
int read = bzip2Is.read(decompressed, originalLength - remaining, remaining);
if (read > 0) {
remaining -= read;
} else {
break;
}
}
assertEquals(-1, bzip2Is.read());
}
return Unpooled.wrappedBuffer(decompressed);
}
}
Source
Frequently Asked Questions
What is the Bzip2EncoderTest class?
Bzip2EncoderTest is a class in the netty codebase, defined in codec-compression/src/test/java/io/netty/handler/codec/compression/Bzip2EncoderTest.java.
Where is Bzip2EncoderTest defined?
Bzip2EncoderTest is defined in codec-compression/src/test/java/io/netty/handler/codec/compression/Bzip2EncoderTest.java at line 29.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free