private void handler(SocketChannel sockChannel){
		// Get the raw body as a byte []
		byte [] fbuf = f.toByteArray();
		
		// Create a BufferedReader for easily reading it as string.
		ByteArrayInputStream bin = new ByteArrayInputStream(fbuf);
		BufferedReader in = new BufferedReader(new InputStreamReader(bin));
		
		
		// If the method is POST, there may be parameters
		// in data section, too, read it:
		String method = httpHeader.getPre().getProperty("method");
		if (method.equalsIgnoreCase( "POST" ))
		{
			String contentType = "";
			String contentTypeHeader = httpHeader.getHeader().getProperty("content-type");
			StringTokenizer st = new StringTokenizer( contentTypeHeader , "; " );
			if ( st.hasMoreTokens()) {
				contentType = st.nextToken();
			}

			if (contentType.equalsIgnoreCase("multipart/form-data"))
			{
				// Handle multipart/form-data
				if ( !st.hasMoreTokens())
					System.out.println("BAD REQUEST: Content type is multipart/form-data but boundary missing. Usage: GET /example/file.html" );
				String boundaryExp = st.nextToken();
				st = new StringTokenizer( boundaryExp , "=" );
				if (st.countTokens() != 2)
					System.out.println("BAD REQUEST: Content type is multipart/form-data but boundary syntax error. Usage: GET /example/file.html" );
				st.nextToken();
				String boundary = st.nextToken();
				decodeMultipartData(boundary, fbuf, in, httpHeader.getParms(), httpHeader.getFiles());
			}
			else
			{
				// Handle application/x-www-form-urlencoded
				String postLine = "";
				char pbuf[] = new char[512];
				int read;
				try {
					read = in.read(pbuf);
					while ( read >= 0 && !postLine.endsWith("\r\n") )
					{
						postLine += String.valueOf(pbuf, 0, read);
						read = in.read(pbuf);
					}
					postLine = postLine.trim();
					postLine = URLDecoder.decode(postLine, "UTF-8");
					decodeParms( postLine, httpHeader.getParms());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				
			}
		}
		
		if (method.equalsIgnoreCase("PUT"))
			httpHeader.getFiles().put("content", saveTmpFile(fbuf, 0, f.size()));
		
		Response r = getResponse();
		resByteBuffer = sendResponse(r.status, r.mimeType, r.header, r.text);
		state = WRITE_STATE;
		prepareWrite();
	}