Rocker: use StringBuilderOutput
package io.jooby.rocker;
import com.fizzed.rocker.RockerModel;
-import com.fizzed.rocker.runtime.ArrayOfByteArraysOutput;
+import com.fizzed.rocker.runtime.StringBuilderOutput;
import io.jooby.Context;
import io.jooby.MediaType;
import io.jooby.Route;
import javax.annotation.Nonnull;
-import java.util.List;
class RockerHandler implements Route.Handler {
private final Route.Handler next;
@@ -24,11 +23,8 @@ class RockerHandler implements Route.Handler {
@Nonnull @Override public Object apply(@Nonnull Context ctx) throws Exception {
try {
RockerModel template = (RockerModel) next.apply(ctx);
- ArrayOfByteArraysOutput buff = template.render(ArrayOfByteArraysOutput.FACTORY);
- List<byte[]> arrays = buff.getArrays();
ctx.setResponseType(MediaType.html);
- ctx.setResponseLength(buff.getByteLength());
- ctx.send(arrays.toArray(new byte[arrays.size()][]));
+ ctx.send(template.render(StringBuilderOutput.FACTORY).toString());
return ctx;
} catch (Throwable x) {
ctx.sendError(x);
