private Component findComponent(int index) { int readable = 0; for (int i = 0 ; i < buffers.length; i++) { Component comp = null; ByteBuf b = buffers[i]; if (b instanceof Component) { comp = (Component) b; b = comp.buf; } readable += b.readableBytes(); if (index < readable) { if (comp == null) { // Create a new component and store it in the array so it not create a new object // on the next access. comp = new Component(i, readable - b.readableBytes(), b); buffers[i] = comp; } return comp; } } throw new IllegalStateException(); }
private Component findComponent(int index) { int readable = 0; for (int i = 0 ; i < buffers.length; i++) { Component comp = null; ByteBuf b; Object obj = buffers[i]; boolean isBuffer; if (obj instanceof ByteBuf) { b = (ByteBuf) obj; isBuffer = true; } else { comp = (Component) obj; b = comp.buf; isBuffer = false; } readable += b.readableBytes(); if (index < readable) { if (isBuffer) { // Create a new component and store it in the array so it not create a new object // on the next access. comp = new Component(i, readable - b.readableBytes(), b); buffers[i] = comp; } return comp; } } throw new IllegalStateException(); }
private Component findComponent(int index) { int readable = 0; for (int i = 0 ; i < buffers.length; i++) { Component comp = null; ByteBuf b; Object obj = buffers[i]; boolean isBuffer; if (obj instanceof ByteBuf) { b = (ByteBuf) obj; isBuffer = true; } else { comp = (Component) obj; b = comp.buf; isBuffer = false; } readable += b.readableBytes(); if (index < readable) { if (isBuffer) { // Create a new component and store it in the array so it not create a new object // on the next access. comp = new Component(i, readable - b.readableBytes(), b); buffers[i] = comp; } return comp; } } throw new IllegalStateException(); }
private Component findComponent(int index) { int readable = 0; for (int i = 0 ; i < buffers.length; i++) { Component comp = null; ByteBuf b = buffers[i]; if (b instanceof Component) { comp = (Component) b; b = comp.buf; } readable += b.readableBytes(); if (index < readable) { if (comp == null) { // Create a new component and store it in the array so it not create a new object // on the next access. comp = new Component(i, readable - b.readableBytes(), b); buffers[i] = comp; } return comp; } } throw new IllegalStateException(); }
private Component findComponent(int index) { int readable = 0; for (int i = 0 ; i < buffers.length; i++) { Component comp = null; ByteBuf b = buffers[i]; if (b instanceof Component) { comp = (Component) b; b = comp.buf; } readable += b.readableBytes(); if (index < readable) { if (comp == null) { // Create a new component and store it in the array so it not create a new object // on the next access. comp = new Component(i, readable - b.readableBytes(), b); buffers[i] = comp; } return comp; } } throw new IllegalStateException(); }
private Component findComponent(int index) { int readable = 0; for (int i = 0 ; i < buffers.length; i++) { Component comp = null; ByteBuf b = buffers[i]; if (b instanceof Component) { comp = (Component) b; b = comp.buf; } readable += b.readableBytes(); if (index < readable) { if (comp == null) { // Create a new component and store it in the array so it not create a new object // on the next access. comp = new Component(i, readable - b.readableBytes(), b); buffers[i] = comp; } return comp; } } throw new IllegalStateException(); }
private Component findComponent(int index) { int readable = 0; for (int i = 0 ; i < buffers.length; i++) { Component comp = null; ByteBuf b = buffers[i]; if (b instanceof Component) { comp = (Component) b; b = comp.buf; } readable += b.readableBytes(); if (index < readable) { if (comp == null) { // Create a new component and store it in the array so it not create a new object // on the next access. comp = new Component(i, readable - b.readableBytes(), b); buffers[i] = comp; } return comp; } } throw new IllegalStateException(); }