// Plain old HttpRequest
try {
final Request request = parseRequest(ctx, nettyRequest, messageEvent);
final Response response = new Response();
Http.Response.current.set(response);
// Buffered in memory output
response.out = new ByteArrayOutputStream();
// Direct output (will be set later)
response.direct = null;
// Streamed output (using response.writeChunk)
response.onWriteChunk(new Action<Object>() {
public void invoke(Object result) {
writeChunk(request, response, ctx, nettyRequest, result);
}
});