@Override
	protected Object decode(State state, IOBuffer buffer, Channel channel)
			throws Exception
	{
		String line;
		switch(state)
		{
			case HEADER_FIRST_LINE:
				header = new HttpRequestHeader();
				line = readLine(buffer);

				String[] firstLine = line.split(" ");
				header.setMethod(firstLine[0].trim());
				header.setPlainUri(firstLine[1].trim());
				header.setVersion(firstLine[2].trim());

				checkpoint(State.HEADER);

			case HEADER:
				while( true )
				{
					line = readLine(buffer);

					if( line.length() == 0 )
						break;

					String[] keyValue = line.split(":");
					header.addHeader(keyValue[0], keyValue[1]);
					checkpoint(State.HEADER);
				}

				checkpoint(State.BODY);

				return header;

			case BODY:
				if( header.getMethod().equals("post") )
					;
				String contentLengthString = header.getHeader("content-length");
				
				int contentLength = Integer.parseInt(contentLengthString);
				
				checkpoint(State.BODY);

				checkpoint();
		}

		return null;
	}