code: private HttpContent encodeNextChunkMultipart(int sizeleft) throws ErrorDataEncoderException {
          if (currentData == null) {
              return null;
          }
          ByteBuf buffer;
          if (currentData instanceof InternalAttribute) {
              buffer = ((InternalAttribute) currentData).toByteBuf();
              currentData = null;
          } else {
              try {
                  buffer = ((HttpData) currentData).getChunk(sizeleft);
              } catch (IOException e) {
                  throw new ErrorDataEncoderException(e);
              }
              if (buffer.capacity() == 0) {
                  // end for current InterfaceHttpData, need more data
                  currentData = null;
                  return null;
              }
          }
          if (currentBuffer == null) {
              currentBuffer = buffer;
          } else {
              currentBuffer = wrappedBuffer(currentBuffer, buffer);
          }
          if (currentBuffer.readableBytes() < HttpPostBodyUtil.chunkSize) {
              currentData = null;
              return null;
          }
          buffer = fillByteBuf();
          return new DefaultHttpContent(buffer);
      }
docs: From the current context (currentBuffer and currentData), returns the next HttpChunk (if possible) trying to get
  sizeleft bytes more into the currentBuffer. This is the Multipart version.
  
  @param sizeleft
  the number of bytes to try to get from currentData
  @return the next HttpChunk or null if not enough bytes were found
  @throws ErrorDataEncoderException
  if the encoding is in error