private String buildheader(int codeIn, int fileextIn) {
        int code = codeIn;
        int fileext = fileextIn;

        String header = "";

        if (code == 200) {
            header = "HTTP/1.1 200 OK";
        }

        if (code == 404) {
            header = "HTTP/1.1 404 Not Found";
        }

        header += "\r\n";
        header += "Connection: close\r\n";
        header += "Server: Nippelhttpd/0.1\r\n";


        switch (fileext) {
            case 0:
                break;
            case 1:
                header += "Content-Type: image/jpeg\r\n";
                break;
            case 2:
                header += "Content-Type: image/gif\r\n";
                break;
            case 3:
                header += "Content-Type: image/png\r\n";
                break;
            case 4:
                header += "Content-Type: application/xhtml+xml\r\n";
                break;
            case 5:
                header += "Content-Type: application/xml\r\n";
                break;
            case 6:
                header += "Content-Type: text/css\r\n";
                break;
            default:
                header += "Content-Type: text/html\r\n";
                break;
        }
        header += "\r\n";

        log.debug(" the return header is:" + header);

        return header;
    }