All pastes #708698 Raw Edit

Untitled

public text v1 · immutable
#708698 ·published 2007-09-24 02:07 UTC
rendered paste body
    void readMyFile()
    {
        DataInputStream dis = null;
        String record = null;
        int index = 0;
        
        try
        {
            File f =  new File("dictionary.txt");
            FileInputStream fis = new FileInputStream(f);
            BufferedInputStream bis = new BufferedInputStream(fis);
            dis = new DataInputStream(bis);
            
            while( (record = dis.readLine()) != null )
            {
                words.add(index);
                index++;
                System.out.println(index + ": " + record);
            }
            
        }