Home / Class/ WriteFailingByteBuf Class — netty Architecture

WriteFailingByteBuf Class — netty Architecture

Architecture documentation for the WriteFailingByteBuf class in ByteToMessageDecoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  4403d99f_24c8_9baa_7c1f_60e0b09ed8ee["WriteFailingByteBuf"]
  7546c8b4_deb3_9871_fb31_44de7e30e65b["ByteToMessageDecoderTest.java"]
  4403d99f_24c8_9baa_7c1f_60e0b09ed8ee -->|defined in| 7546c8b4_deb3_9871_fb31_44de7e30e65b
  707c517b_e271_bef6_22f5_a792b0b4256a["WriteFailingByteBuf()"]
  4403d99f_24c8_9baa_7c1f_60e0b09ed8ee -->|method| 707c517b_e271_bef6_22f5_a792b0b4256a
  6b83c9e6_ac06_369e_2bbe_079742a83b29["ByteBuf()"]
  4403d99f_24c8_9baa_7c1f_60e0b09ed8ee -->|method| 6b83c9e6_ac06_369e_2bbe_079742a83b29
  096063bb_b707_8164_e6bf_21a354afe7d5["Error()"]
  4403d99f_24c8_9baa_7c1f_60e0b09ed8ee -->|method| 096063bb_b707_8164_e6bf_21a354afe7d5

Relationship Graph

Source Code

codec-base/src/test/java/io/netty/handler/codec/ByteToMessageDecoderTest.java lines 323–343

    static class WriteFailingByteBuf extends UnpooledHeapByteBuf {
        private final Error error = new Error();
        private int untilFailure;

        WriteFailingByteBuf(int untilFailure, int capacity) {
            super(UnpooledByteBufAllocator.DEFAULT, capacity, capacity);
            this.untilFailure = untilFailure;
        }

        @Override
        public ByteBuf setBytes(int index, ByteBuf src, int srcIndex, int length) {
            if (--untilFailure <= 0) {
                throw error;
            }
            return super.setBytes(index, src, srcIndex, length);
        }

        Error writeError() {
            return error;
        }
    }

Frequently Asked Questions

What is the WriteFailingByteBuf class?
WriteFailingByteBuf is a class in the netty codebase, defined in codec-base/src/test/java/io/netty/handler/codec/ByteToMessageDecoderTest.java.
Where is WriteFailingByteBuf defined?
WriteFailingByteBuf is defined in codec-base/src/test/java/io/netty/handler/codec/ByteToMessageDecoderTest.java at line 323.

Analyze Your Own Codebase

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

Try Supermodel Free