public void writeTo( ByteArrayOutputStream wordDocumentStream, ByteArrayOutputStream tableStream, int fcMin, CharIndexTranslator translator ) throws IOException { /* * Page 35: * * "Associated with each interval is a BTE. A BTE holds a four-byte PN * (page number) which identifies the FKP page in the file which * contains the formatting information for that interval. A CHPX FKP * further partitions an interval into runs of exception text." */ PlexOfCps bte = new PlexOfCps( 4 ); // each FKP must start on a 512 byte page. int docOffset = wordDocumentStream.size(); int mod = docOffset % POIFSConstants.SMALLER_BIG_BLOCK_SIZE; if (mod != 0) { byte[] padding = new byte[POIFSConstants.SMALLER_BIG_BLOCK_SIZE - mod]; wordDocumentStream.write(padding); } // get the page number for the first fkp docOffset = wordDocumentStream.size(); int pageNum = docOffset/POIFSConstants.SMALLER_BIG_BLOCK_SIZE; // get the ending fc // CHPX lastRun = _textRuns.get(_textRuns.size() - 1);
public void writeTo( HWPFOutputStream wordDocumentStream, HWPFOutputStream tableStream, int fcMin, CharIndexTranslator translator ) throws IOException { /* * Page 35: * * "Associated with each interval is a BTE. A BTE holds a four-byte PN * (page number) which identifies the FKP page in the file which * contains the formatting information for that interval. A CHPX FKP * further partitions an interval into runs of exception text." */ PlexOfCps bte = new PlexOfCps( 4 ); // each FKP must start on a 512 byte page. int docOffset = wordDocumentStream.getOffset(); int mod = docOffset % POIFSConstants.SMALLER_BIG_BLOCK_SIZE; if (mod != 0) { byte[] padding = new byte[POIFSConstants.SMALLER_BIG_BLOCK_SIZE - mod]; wordDocumentStream.write(padding); } // get the page number for the first fkp docOffset = wordDocumentStream.getOffset(); int pageNum = docOffset/POIFSConstants.SMALLER_BIG_BLOCK_SIZE; // get the ending fc // CHPX lastRun = _textRuns.get(_textRuns.size() - 1);
_cbt.writeTo(wordDocumentStream, tableStream, mainOffset, _cft.getTextPieceTable()); _fib.setLcbPlcfbteChpx(tableStream.size() - tableOffset); tableOffset = tableStream.size();
_cbt.writeTo(wordDocumentStream, tableStream, fcMin, _cft.getTextPieceTable()); _fib.setLcbPlcfbteChpx(tableStream.getOffset() - tableOffset); tableOffset = tableStream.getOffset();