code: public List<ByteBuf> decompose(int offset, int length) {
          checkIndex(offset, length);
          if (length == 0) {
              return Collections.emptyList();
          }
  
          int componentId = toComponentIndex0(offset);
          int bytesToSlice = length;
          // The first component
          Component firstC = components[componentId];
  
          ByteBuf slice = firstC.buf.slice(firstC.idx(offset), Math.min(firstC.endOffset - offset, bytesToSlice));
          bytesToSlice -= slice.readableBytes();
  
          if (bytesToSlice == 0) {
              return Collections.singletonList(slice);
          }
  
          List<ByteBuf> sliceList = new ArrayList<ByteBuf>(componentCount - componentId);
          sliceList.add(slice);
  
          // Add all the slices until there is nothing more left and then return the List.
          do {
              Component component = components[++componentId];
              slice = component.buf.slice(component.idx(component.offset), Math.min(component.length(), bytesToSlice));
              bytesToSlice -= slice.readableBytes();
              sliceList.add(slice);
          } while (bytesToSlice > 0);
  
          return sliceList;
      }
docs: Same with {@link #slice(int, int)} except that this method returns a list.