FileDocCategorySizeDatePackage
EFBiffViewer.javaAPI DocApache Poi 3.0.12931Mon Jan 01 12:39:36 GMT 2007org.apache.poi.hssf.dev

EFBiffViewer

public class EFBiffViewer extends Object
author
andy

Fields Summary
String
file
Constructors Summary
public EFBiffViewer()
Creates a new instance of EFBiffViewer

    
Methods Summary
public static voidmain(java.lang.String[] args)

        if ((args.length == 1) && !args[ 0 ].equals("--help"))
        {
            try
            {
                EFBiffViewer viewer = new EFBiffViewer();

                viewer.setFile(args[ 0 ]);
                viewer.run();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
        }
        else
        {
            System.out.println("EFBiffViewer");
            System.out.println(
                "Outputs biffview of records based on HSSFEventFactory");
            System.out
                .println("usage: java org.apache.poi.hssf.dev.EBBiffViewer "
                         + "filename");
        }
    
public voidrun()

        FileInputStream fin   = new FileInputStream(file);
        POIFSFileSystem poifs = new POIFSFileSystem(fin);
        InputStream     din   = poifs.createDocumentInputStream("Workbook");
        HSSFRequest     req   = new HSSFRequest();

        req.addListenerForAllRecords(new HSSFListener()
        {
            public void processRecord(Record rec)
            {
                System.out.println(rec.toString());
            }
        });
        HSSFEventFactory factory = new HSSFEventFactory();

        factory.processEvents(req, din);
    
public voidsetFile(java.lang.String file)

        this.file = file;