You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by jia <ji...@hotmail.com> on 2011/04/16 11:12:14 UTC

why doc.getDataStream().length return 0

Hi every one,

I'm new to Java and POI. Forgive me if the question is stupid. 

I wrote the program to test POI, but dataStream is "empty". Any help is
appreciated.


import java.io.FileInputStream;
import java.io.IOException;

import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;

public class PoiTest {
	public static void main( String[] args ) throws IOException {
	String fileName = "C:/hello.doc";
	POIFSFileSystem fs = new POIFSFileSystem( new FileInputStream( fileName )
);
        HWPFDocument document = new HWPFDocument(fs);
        byte[] stream = document.getDataStream();
        System.out.println( stream.length );
	}
}


--
View this message in context: http://apache-poi.1045710.n5.nabble.com/why-doc-getDataStream-length-return-0-tp4307180p4307180.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org