java中導入excel判斷03仍是07

InputStream inp = new FileInputStream(path);
	if(! inp.markSupported()) {
	inp = new PushbackInputStream(inp, 8);
	}
	if(POIFSFileSystem.hasPOIFSHeader(inp)) {
	System.out.println("2003及如下");
	}
	if(POIXMLDocument.hasOOXMLHeader(inp)) {
	System.out.println("2007及以上");
	}
相關文章
相關標籤/搜索