public static List openFile(File file)
{
List list = new ArrayList();
File saveFile = file;
try
{
FileReader fileReader = new FileReader(saveFile);
BufferedReader bufferedReader = new BufferedReader(fileReader);
String str;
while((str = bufferedReader.readLine()) != null)
{
String [] sData = str.split("\\--");
list.add(sData);
}
bufferedReader.close();
fileReader.close();
}
catch(Exception exc){exc.printStackTrace();}
return list;
}
没有评论:
发表评论