Home / Class/ CompositeByteBufIterator Class — netty Architecture

CompositeByteBufIterator Class — netty Architecture

Architecture documentation for the CompositeByteBufIterator class in CompositeByteBuf.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  15d6a895_7cb4_cbcd_0763_faa941b5be8c["CompositeByteBufIterator"]
  cd81e19c_f257_609a_ecbe_84b481e22251["CompositeByteBuf.java"]
  15d6a895_7cb4_cbcd_0763_faa941b5be8c -->|defined in| cd81e19c_f257_609a_ecbe_84b481e22251
  9a5f78a5_4775_4fb1_333c_9f62fbab494d["hasNext()"]
  15d6a895_7cb4_cbcd_0763_faa941b5be8c -->|method| 9a5f78a5_4775_4fb1_333c_9f62fbab494d
  12435005_caa2_ec6d_e39b_831ac5ea7ab1["ByteBuf()"]
  15d6a895_7cb4_cbcd_0763_faa941b5be8c -->|method| 12435005_caa2_ec6d_e39b_831ac5ea7ab1
  533d7425_0835_bfe5_dffe_67d1b2604b42["remove()"]
  15d6a895_7cb4_cbcd_0763_faa941b5be8c -->|method| 533d7425_0835_bfe5_dffe_67d1b2604b42

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java lines 2302–2330

    private final class CompositeByteBufIterator implements Iterator<ByteBuf> {
        private final int size = numComponents();
        private int index;

        @Override
        public boolean hasNext() {
            return size > index;
        }

        @Override
        public ByteBuf next() {
            if (size != numComponents()) {
                throw new ConcurrentModificationException();
            }
            if (!hasNext()) {
                throw new NoSuchElementException();
            }
            try {
                return components[index++].slice();
            } catch (IndexOutOfBoundsException e) {
                throw new ConcurrentModificationException();
            }
        }

        @Override
        public void remove() {
            throw new UnsupportedOperationException("Read-Only");
        }
    }

Frequently Asked Questions

What is the CompositeByteBufIterator class?
CompositeByteBufIterator is a class in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java.
Where is CompositeByteBufIterator defined?
CompositeByteBufIterator is defined in buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java at line 2302.

Analyze Your Own Codebase

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

Try Supermodel Free