public IniFile(String pFilename, String pFileFormat) throws IOException
{

    fileFormat = pFileFormat;

    //create a vector to hold the lines of text read from the file
    buffer = new ArrayList<String>(1000);

    filename = pFilename;
    modified = false; //no data has yet been modified or added

    //create various decimal formats
    DecimalFormats = new DecimalFormat[11];
    DecimalFormats[0] = new  DecimalFormat("#");
    DecimalFormats[1] = new  DecimalFormat("#.#");
    DecimalFormats[2] = new  DecimalFormat("#.##");
    DecimalFormats[3] = new  DecimalFormat("#.###");
    DecimalFormats[4] = new  DecimalFormat("#.####");
    DecimalFormats[5] = new  DecimalFormat("#.#####");
    DecimalFormats[6] = new  DecimalFormat("#.######");
    DecimalFormats[7] = new  DecimalFormat("#.#######");
    DecimalFormats[8] = new  DecimalFormat("#.########");
    DecimalFormats[9] = new  DecimalFormat("#.#########");
    DecimalFormats[10] = new DecimalFormat("#.##########");

    //create a buffered reader stream to the language file

    FileInputStream fileInputStream = null;
    InputStreamReader inputStreamReader = null;
    BufferedReader in = null;

    try{

        fileInputStream = new FileInputStream(filename);

        inputStreamReader = new InputStreamReader(fileInputStream, fileFormat);

        in = new BufferedReader(inputStreamReader);

        String line;

        //read until end of file reached or "[end of header]" tag reached

        while ((line = in.readLine()) != null){
            buffer.add(line);
            if (line.equals("[Header End]")) {break;}
        }
    }
    catch (FileNotFoundException e){
        //if an existing file was not found, add some header info to the buffer
        //so it will be saved when the file is created
        buffer.add("");
        buffer.add(";Do not erase blank line above -"
                   + " has hidden code needed by UTF-16 files.");
        buffer.add(";To make a new file, copy an existing ini file and change"
                   + " only data below this line.");
        buffer.add("");

    }
    catch(IOException e){throw new IOException();}
    finally{
        if (in != null) {in.close();}
        if (inputStreamReader != null) {inputStreamReader.close();}
        if (fileInputStream != null) {fileInputStream.close();}
    }

}//end of IniFile::IniFile (constructor)