Hi,
My application needs to read around 50000 small ascii (1-25lines) files.
Currently I use the BufferedReader API to read ascii files.
Can you suggest something faster than the below.
Thanks
private ArrayList<String> readDataFile(String fileName) {
String lineData;
List<String> fileContents = new ArrayList<String>();
BufferedReader moFile=null;
try {
moFile = new BufferedReader (new FileReader (new File (
fileName)));
while ((lineData = moFile.readLine()) != null)
{
fileContents.add(lineData);
}
} catch(IOException e) {
myLogger.error("Exception caught while reading data
file: " + fileName + e.toString());
}finally {
try {
moFile.close();
}catch(Exception e) {
//Ignore
}
}
return fileContents;
}
--
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code