{
//HttpRequest request = (HttpRequest) e.getMessage();
HttpResponse response = new DefaultHttpResponse(HTTP_1_1, OK);
response.setHeader(CONTENT_TYPE, "text/plain; charset=UTF-8");
ChunkedBodyWritableByteChannel writeChannel = new ChunkedBodyWritableByteChannel(e.getChannel(),
response);
for (String key: _headers.keySet())
{
writeChannel.setMetadata(key, _headers.get(key));
}
for (byte[] chunk: _responseChunks)
{
writeChannel.write(ByteBuffer.wrap(chunk));
}
writeChannel.setResponseCode(_responseCode);
for (String key: _footers.keySet())
{
writeChannel.setMetadata(key, _footers.get(key));
}
writeChannel.close();
}