}
// size > 0
if (currentData != null) {
// continue to read data
if (isMultipart) {
HttpChunk chunk = encodeNextChunkMultipart(size);
if (chunk != null) {
return chunk;
}
} else {
HttpChunk chunk = encodeNextChunkUrlEncoded(size);
if (chunk != null) {
//NextChunk Url from currentData
return chunk;
}
}
size = HttpPostBodyUtil.chunkSize - currentBuffer.readableBytes();
}
if (! iterator.hasNext()) {
isLastChunk = true;
//NextChunk as last non empty from buffer
buffer = currentBuffer;
currentBuffer = null;
return new DefaultHttpChunk(buffer);
}
while (size > 0 && iterator.hasNext()) {
currentData = iterator.next();
HttpChunk chunk;
if (isMultipart) {
chunk = encodeNextChunkMultipart(size);
} else {
chunk = encodeNextChunkUrlEncoded(size);
}