Bootstrap

Invalid header signature; read 0x3C0A0D0A0DBFBBEF, expected 0xE11AB1A1E011CFD0

读取word文档报错 错误信息 Invalid header signature; read 0x3C0A0D0A0DBFBBEF, expected 0xE11AB1A1E011CFD0

    private final static String  filePath = "D:/Test.doc"; 

	public static void main(String[] args) throws FileNotFoundException, IOException {
		
		FileInputStream stream = new FileInputStream(filePath);
		
		System.out.println(stream);
		
		HWPFDocument doc = new HWPFDocument(new FileInputStream(filePath));
		
		System.out.println(doc);
			
	}

解决办法:将读取那个文档,另存为一个文件就好,重新读取

    private final static String  filePath = "D:/TestNew.doc"; 

	public static void main(String[] args) throws FileNotFoundException, IOException {
		
		FileInputStream stream = new FileInputStream(filePath);
		
		System.out.println(stream);
		
		HWPFDocument doc = new HWPFDocument(new FileInputStream(filePath));
		
		System.out.println(doc);
		
	}

 

悦读

道可道,非常道;名可名,非常名。 无名,天地之始,有名,万物之母。 故常无欲,以观其妙,常有欲,以观其徼。 此两者,同出而异名,同谓之玄,玄之又玄,众妙之门。

;