public static void loadConstants() {
        try {
            //get a connection to the constants file and read it
            final String fileName = "file:///" + CONSTANTS_FILE_NAME;
            printIfDebug("Opening constants file: " + fileName);
            FileConnection commandFileConnection = (FileConnection) Connector.open(fileName, Connector.READ);
            DataInputStream commandFileStream = commandFileConnection.openDataInputStream();
            StringBuffer fileContentsBuffer = new StringBuffer((int) commandFileConnection.fileSize());

            //read characters from the file until end of file is reached
            byte[] buff = new byte[255];
            while (commandFileStream.read(buff) != -1) {
                fileContentsBuffer.append(new String(buff));
                //inefficient, but with long files necessary
                buff = new byte[255];
            }
            String fileContents = fileContentsBuffer.toString();
            printIfDebug("Constants file output: " + fileContents);
            StringTokenizer lineTokenizer = new StringTokenizer(fileContents, "\n");
            CONSTANTS = new Vector(lineTokenizer.countTokens());

            //for each line, split into space-separated tokens
            while (lineTokenizer.hasMoreTokens()) {
                String line = lineTokenizer.nextToken().trim();
                if (line.startsWith("#")) {
                    continue;
                }
                StringTokenizer spaceTokenizer = new StringTokenizer(line, " ");
                //map the first two tokens
                if (spaceTokenizer.countTokens() > 1) {
                    final String key = spaceTokenizer.nextToken().trim();
                    final String value = spaceTokenizer.nextToken().trim();
                    CONSTANTS.addElement(new Constant(key, value));
                    printIfDebug("Put constant: " + key + ": " + value + ", of type " + Constant.TYPE_NAMES[((Constant) CONSTANTS.lastElement()).getType()]);
                }
            }
        } catch (Exception ex) {
            System.out.println("Could not load file " + CONSTANTS_FILE_NAME + ". Are you sure it is in the root directory of the cRIO?");
        }
    }