什么文件格式可以通过流来直接读取或写入

1.txt可以直接使用流来操作,因为它的内容就几乎是它代码级的内容

2.office的excel,world,ppt等你在电脑上打开看到的内容,跟它代码级的内容完全不是一回事,可以通过poi来进行处理

Apache POI是Apache软件基金会的开放源码函式库,POI提供API给Java程序对Microsoft Office格式档案读和写的功能。
结构:

HSSF - 提供读写Microsoft Excel格式档案的功能。
XSSF - 提供读写Microsoft Excel OOXML格式档案的功能。
HWPF - 提供读写Microsoft Word格式档案的功能。
HSLF - 提供读写Microsoft PowerPoint格式档案的功能。
HDGF - 提供读写Microsoft Visio格式档案的功能。
处理WORD文档
public class TestPoi {  
public TestPoi() {  
}  
public static void main(String args[]) throws Exception  
{  
FileInputStream in = new FileInputStream ("D:\a.doc");  
WordExtractor extractor = new WordExtractor();  
String str = extractor.extractText(in);  
//System.out.println("the result length is"+str.length());  
System.out.println(str);  
}  
}  
原文地址:https://www.cnblogs.com/zyzg/p/7879215.html