0
import org.apache.poi.hwpf.HWPFDocument;

...

FileInputStream fistream=null;
try {
    fistream = new FileInputStream(basedir+File.separator+filename);
} catch (FileNotFoundException ex) {
    Logger.getLogger(MainGui.class.getName()).log(Level.SEVERE, null, ex);
}
HWPFDocument document=null;
try {
    document = new HWPFDocument(fistream);
} catch (IOException ex) {
    Logger.getLogger(MainGui.class.getName()).log(Level.SEVERE, null, ex);
}

System.out.println("Length of docment is :" + document.characterLength());
System.out.println(document.getTextTable());

我已经进口了 poi 罐子,但它仍然给出了一个例外java.io.IOException: Invalid header signature; read 1688935826934608, expected -2226271756974174256

4

0 回答 0