code: private HttpContent nextChunk() throws ErrorDataEncoderException {
          if (isLastChunk) {
              isLastChunkSent = true;
              return LastHttpContent.EMPTY_LAST_CONTENT;
          }
          // first test if previous buffer is not empty
          int size = calculateRemainingSize();
          if (size <= 0) {
              // NextChunk from buffer
              ByteBuf buffer = fillByteBuf();
              return new DefaultHttpContent(buffer);
          }
          // size > 0
          if (currentData != null) {
              // continue to read data
              HttpContent chunk;
              if (isMultipart) {
                  chunk = encodeNextChunkMultipart(size);
              } else {
                  chunk = encodeNextChunkUrlEncoded(size);
              }
              if (chunk != null) {
                  // NextChunk from data
                  return chunk;
              }
              size = calculateRemainingSize();
          }
          if (!iterator.hasNext()) {
              return lastChunk();
          }
          while (size > 0 && iterator.hasNext()) {
              currentData = iterator.next();
              HttpContent chunk;
              if (isMultipart) {
                  chunk = encodeNextChunkMultipart(size);
              } else {
                  chunk = encodeNextChunkUrlEncoded(size);
              }
              if (chunk == null) {
                  // not enough
                  size = calculateRemainingSize();
                  continue;
              }
              // NextChunk from data
              return chunk;
          }
          // end since no more data
          return lastChunk();
      }
docs: Returns the next available HttpChunk. The caller is responsible to test if this chunk is the last one (isLast()),
  in order to stop calling this getMethod.
  
  @return the next available HttpChunk
  @throws ErrorDataEncoderException
  if the encoding is in error