@@ -0,0 +1,1558 @@
+// Copyright 2014, Kevin Ko %3Ckevin@faveset.com%3E%0A%0Apackage com.faveset.khttp;%0A%0Aimport java.nio.ByteBuffer;%0Aimport java.util.Map;%0A%0Aclass MessageBodyHandler implements StateHandler %7B%0A    public boolean handleState(NonBlockingConnection conn, ByteBuffer buf, HandlerState state) throws InvalidRequestException %7B%0A        HttpRequest req = state.getRequestBuilder();%0A%0A        // Trim the data buff depending on request's headers.%0A        switch (req.getMethod()) %7B%0A            case GET:%0A                return handleGet(buf, state, req);%0A%0A            case POST:%0A            case PUT:%0A            case HEAD:%0A            default:%0A                return handleRaw(buf, state, req);%0A        %7D%0A    %7D%0A%0A    /**%0A     * @return true if the state is done processing.%0A     */%0A    private boolean handleGet(ByteBuffer buf, HandlerState state, HttpRequest req) throws InvalidRequestException %7B%0A        // TODO: handle conditionals%0A        // TODO: handle partials%0A%0A        // TODO: where do you assign the OnRequestCallback to state?%0A        HandlerState.OnRequestCallback handler = state.getOnRequestCallback();%0A%0A        ByteBuffer getBuf = buf.duplicate();%0A        // Get methods have no payload.%0A        getBuf.clear();%0A        return handler.onRequest(req, getBuf, state.getResponseWriter());%0A    %7D%0A%0A    private boolean handleRaw(ByteBuffer buf, HandlerState state, HttpRequest req) throws InvalidRequestException %7B%0A        HandlerState.OnRequestCallback handler = state.getOnRequestCallback();%0A        return handler.onRequest(req, buf, state.getResponseWriter());%0A    %7D%0A%7D%0A

Add rudimentary request body handler.