.append("\r\n\r\nEND OF NOT CHUNKED CONTENT\r\n");
writeResponse(e.getChannel());
}
} else {
// New chunk is received
HttpChunk chunk = (HttpChunk) e.getMessage();
try {
decoder.offer(chunk);
} catch (ErrorDataDecoderException e1) {
e1.printStackTrace();
responseContent.append(e1.getMessage());
writeResponse(e.getChannel());
Channels.close(e.getChannel());
return;
}
responseContent.append("o");
// example of reading chunk by chunk (minimize memory usage due to Factory)
readHttpDataChunkByChunk(e.getChannel());
// example of reading only if at the end
if (chunk.isLast()) {
readHttpDataAllReceive(e.getChannel());
writeResponse(e.getChannel());
readingChunks = false;
}
}