Package org.apache.poi.poifs.filesystem

Examples of org.apache.poi.poifs.filesystem.POIFSFileSystem.createDocumentInputStream()


    }

    DocumentEntry table = (DocumentEntry)fsys.getRoot().getEntry(tableName);
    byte[] tableStream = new byte[table.getSize()];

    din = fsys.createDocumentInputStream(tableName);

    din.read(tableStream);
    din.close();

    int chpOffset = LittleEndian.getInt(header, 0xfa);
View Full Code Here


            // create a new file input stream with the input file specified
            // at the command line
            fin = new FileInputStream(filename);

            POIFSFileSystem poifs = new POIFSFileSystem(fin);
            din = poifs.createDocumentInputStream("Workbook");
            HSSFRequest req = new HSSFRequest();
            req.addListenerForAllRecords(el);
            HSSFEventFactory factory = new HSSFEventFactory();
            factory.processEvents(req, din);
View Full Code Here

    {
        POIFSFileSystem fs      =
            new POIFSFileSystem(new FileInputStream(file));
        List            records =
            RecordFactory
                .createRecords(fs.createDocumentInputStream("Workbook"));

        for (int k = 0; k < records.size(); k++)
        {
            Record record = ( Record ) records.get(k);
View Full Code Here

    public void run() {
        try {
            POIFSFileSystem fs =
                    new POIFSFileSystem(new FileInputStream(filename));
            InputStream stream =
                    fs.createDocumentInputStream("Workbook");
            createRecords(stream, dump);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

                }
                if ((args.length > 1) && args[1].equals("bfd")) {
                    POIFSFileSystem fs =
                            new POIFSFileSystem(new FileInputStream(args[0]));
                    InputStream stream =
                            fs.createDocumentInputStream("Workbook");
                    int size = stream.available();
                    byte[] data = new byte[size];

                    stream.read(data);
                    HexDump.dump(data, 0, System.out, 0);
View Full Code Here

    public void run() {
        try {
            POIFSFileSystem fs =
                    new POIFSFileSystem(new FileInputStream(filename));
            InputStream stream =
                    fs.createDocumentInputStream("Workbook");
            createRecords(stream, dump);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

                }
                if ((args.length > 1) && args[1].equals("bfd")) {
                    POIFSFileSystem fs =
                            new POIFSFileSystem(new FileInputStream(args[0]));
                    InputStream stream =
                            fs.createDocumentInputStream("Workbook");
                    int size = stream.available();
                    byte[] data = new byte[size];

                    stream.read(data);
                    HexDump.dump(data, 0, System.out, 0);
View Full Code Here

        book = new HSSFWorkbook();
        ByteArrayOutputStream stream = (ByteArrayOutputStream)setupRunFile(book);   
        POIFSFileSystem fs = new POIFSFileSystem(
                                   new ByteArrayInputStream(stream.toByteArray())
                                   );
        in = fs.createDocumentInputStream("Workbook");
    }

    protected void tearDown() throws Exception
    {
        super.tearDown();
View Full Code Here

        HSSFWorkbook wb = new HSSFWorkbook(fs);

        //set POIFS properties after constructing HSSFWorkbook
        //(a piece of code that used to work up to POI 3.0.2)
        SummaryInformation summary1 = (SummaryInformation)PropertySetFactory.create(fs.createDocumentInputStream(SummaryInformation.DEFAULT_STREAM_NAME));
        summary1.setTitle(title);
        //write the modified property back to POIFS
        fs.getRoot().getEntry(SummaryInformation.DEFAULT_STREAM_NAME).delete();
        fs.createDocument(summary1.toInputStream(), SummaryInformation.DEFAULT_STREAM_NAME);
View Full Code Here

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        wb.write(out);
        out.close();

        POIFSFileSystem fs2 = new POIFSFileSystem(new ByteArrayInputStream(out.toByteArray()));
        SummaryInformation summary2 = (SummaryInformation)PropertySetFactory.create(fs2.createDocumentInputStream(SummaryInformation.DEFAULT_STREAM_NAME));

        //failing assertion
        assertEquals(title, summary2.getTitle());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.