Package org.apache.poi.poifs.filesystem

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


    {
        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

        DocumentEntry headerProps =
            (DocumentEntry)filesystem.getRoot().getEntry("WordDocument");

        byte[] mainDocument = new byte[headerProps.getSize()];
        filesystem.createDocumentInputStream("WordDocument").read(mainDocument);

        FileInformationBlock fib = new FileInformationBlock(mainDocument);


        results.add(fib);
View Full Code Here

    doc.readProperties();
    doc.writeProperties(outFS);

    // Should now hold them
    assertNotNull(
        outFS.createDocumentInputStream("\005SummaryInformation")
    );
    assertNotNull(
        outFS.createDocumentInputStream("\005DocumentSummaryInformation")
    );
  }
View Full Code Here

    // Should now hold them
    assertNotNull(
        outFS.createDocumentInputStream("\005SummaryInformation")
    );
    assertNotNull(
        outFS.createDocumentInputStream("\005DocumentSummaryInformation")
    );
  }

  public void testWriteReadProperties() throws Exception {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

      ERFListener erfListener = null; // new MyERFListener();
      EventRecordFactory erf = new EventRecordFactory(erfListener, null);
      try {
        POIFSFileSystem fs = new POIFSFileSystem(new ByteArrayInputStream(baos.toByteArray()));
        erf.processRecords(fs.createDocumentInputStream("Workbook"));
      } catch (RecordFormatException e) {
        throw new RuntimeException(e);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
View Full Code Here

      } else {
        ps = System.out;
      }

      POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(cmdArgs.getFile()));
      InputStream is = fs.createDocumentInputStream("Workbook");

      if (cmdArgs.shouldOutputRawHexOnly()) {
        int size = is.available();
        byte[] data = new byte[size];
View Full Code Here

        book = new HSSFWorkbook();
        ByteArrayOutputStream stream = 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

              POIDataSamples.getDocumentInstance().openResourceAsStream("test.doc"));

      DocumentEntry documentProps =
        (DocumentEntry) filesystem.getRoot().getEntry("WordDocument");
      _mainStream = new byte[documentProps.getSize()];
      filesystem.createDocumentInputStream("WordDocument").read(_mainStream);

      // use the fib to determine the name of the table stream.
      _fib = new FileInformationBlock(_mainStream);

      String name = "0Table";
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.