FileDocCategorySizeDatePackage
TestListTables.javaAPI DocApache Poi 3.0.11989Mon Jan 01 18:55:36 GMT 2007org.apache.poi.hwpf.model

TestListTables

public class TestListTables extends HWPFTestCase

Fields Summary
Constructors Summary
public TestListTables()

  
Methods Summary
public voidtestReadWrite()

    FileInformationBlock fib = _hWPFDocFixture._fib;
    byte[] tableStream = _hWPFDocFixture._tableStream;

    int listOffset = fib.getFcPlcfLst();
    int lfoOffset = fib.getFcPlfLfo();
    if (listOffset != 0 && fib.getLcbPlcfLst() != 0)
    {
      ListTables listTables = new ListTables (tableStream, fib.getFcPlcfLst (),
                                              fib.getFcPlfLfo ());
      HWPFFileSystem fileSys = new HWPFFileSystem ();

      HWPFOutputStream tableOut = fileSys.getStream ("1Table");

      listTables.writeListDataTo (tableOut);
      int offset = tableOut.getOffset ();
      listTables.writeListOverridesTo (tableOut);

      ListTables newTables = new ListTables (tableOut.toByteArray (), 0, offset);

      assertEquals(listTables, newTables);

    }