public static ArrayList<BillAccount> readBillAccounts(String filename)
    {

        File file = new File(filename);
        if (file.exists())
        {
            ObjectInputStream ois = null;
            try
            {
                //
                // Read the previously stored SecretKey.
                //
                SecretKey key = (SecretKey) readFromFile(KEY_FILE.toString());
                ArrayList<BillAccount> accountList = new ArrayList<BillAccount>();
                ois = new ObjectInputStream(new FileInputStream(filename));
                BillAccount tempAccount = null;
                SealedObject tempSealed = null;
                boolean eof = false;
                while (!eof)
                {
                    tempSealed = (SealedObject) ois.readObject();
                    //
                    // Preparing Cipher object from decryption.
                    //
                    String algorithmName = tempSealed.getAlgorithm();
                    Cipher objCipher = Cipher.getInstance(algorithmName);
                    objCipher.init(Cipher.DECRYPT_MODE, key);
                    tempAccount = (BillAccount) tempSealed.getObject(objCipher);
                    if (tempAccount == null)
                    {
                        eof = true;
                        break;
                    }
                    
                    accountList.add(tempAccount);
                }
                
                    
                    
                return accountList;
                
            } catch (EOFException e)
            {
            } catch (Exception e)
            {
                e.printStackTrace();
            } finally
            {
                try
                {
                    if (ois != null)
                    {
                        ois.close();
                    }
                } catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
        }
        return null;
    }