Search in sources :

Example 1 with HSSFListener

use of org.apache.poi.hssf.eventusermodel.HSSFListener in project poi by apache.

the class EFBiffViewer method run.

public void run() throws IOException {
    NPOIFSFileSystem fs = new NPOIFSFileSystem(new File(file), true);
    try {
        InputStream din = BiffViewer.getPOIFSInputStream(fs);
        try {
            HSSFRequest req = new HSSFRequest();
            req.addListenerForAllRecords(new HSSFListener() {

                public void processRecord(Record rec) {
                    System.out.println(rec);
                }
            });
            HSSFEventFactory factory = new HSSFEventFactory();
            factory.processEvents(req, din);
        } finally {
            din.close();
        }
    } finally {
        fs.close();
    }
}
Also used : HSSFEventFactory(org.apache.poi.hssf.eventusermodel.HSSFEventFactory) NPOIFSFileSystem(org.apache.poi.poifs.filesystem.NPOIFSFileSystem) InputStream(java.io.InputStream) HSSFRequest(org.apache.poi.hssf.eventusermodel.HSSFRequest) Record(org.apache.poi.hssf.record.Record) HSSFListener(org.apache.poi.hssf.eventusermodel.HSSFListener) File(java.io.File)

Aggregations

File (java.io.File)1 InputStream (java.io.InputStream)1 HSSFEventFactory (org.apache.poi.hssf.eventusermodel.HSSFEventFactory)1 HSSFListener (org.apache.poi.hssf.eventusermodel.HSSFListener)1 HSSFRequest (org.apache.poi.hssf.eventusermodel.HSSFRequest)1 Record (org.apache.poi.hssf.record.Record)1 NPOIFSFileSystem (org.apache.poi.poifs.filesystem.NPOIFSFileSystem)1