Reading worddoc file
Hi..
i am reading a worddoc of 3000 pages(17MB file) using poi 3, its giving me the below exception.plz help me
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
below is th code
/**
*/
public final static Reader getDOCContent(final File f) {
Reader reader = null;
FileInputStream fis = null;
try {
fis = new FileInputStream(f);
WordExtractor we = new WordExtractor(fis);
String contents= we.getText();
reader = new StringReader(contents);
}
catch (FileNotFoundException e) {
System.out.println(" file not found exception in doc" + e.getClass());
e.printStackTrace();
}
catch (Exception e) {
System.out.println("exception in doc " + e.getClass());
e.printStackTrace();
}
finally {
if (fis != null) {
try {
fis.close();
}
catch (IOException e1) {
System.out.println(" io exception in doc" + e1.getClass());
e1.printStackTrace();
}
}
}
return reader;
}

