public static String[] buildRicListFromFile(String ricFileName, int maxCount)
    {
        RandomAccessFile dataFile = null;
        try
        {
            int i = 0;
            dataFile = new RandomAccessFile(ricFileName, "r");
            String line = dataFile.readLine();
            ArrayList<String> itemList = new ArrayList<String>();

            while (line != null && (line = line.trim()).length() > 0)
            {
                line = dataFile.readLine();
                if ((maxCount == -1 || i < maxCount) && line != null
                        && (line = line.trim()).length() > 0)
                {
                    itemList.add(line);
                    i++;
                }
            }
            String[] ricList = new String[itemList.size()];
            ricList = (String[])itemList.toArray(ricList);

            dataFile.close();
            dataFile = null;
            itemList = null;

            return ricList;
        }
        catch (FileNotFoundException ex)
        {
            return null;
        }
        catch (IOException ex)
        {
            System.out.println("IO error processing " + ex.getMessage());
            System.out.println("Exiting...");
            System.exit(1);
        }
        return null;
    }