/** * This constructs a CHPFormattedDiskPage from a raw fkp (512 byte array * read from a Word file). */ public CHPFormattedDiskPage( byte[] documentStream, int offset, CharIndexTranslator translator ) { super( documentStream, offset ); for ( int x = 0; x < _crun; x++ ) { int bytesStartAt = getStart( x ); int bytesEndAt = getEnd( x ); // int charStartAt = translator.getCharIndex( bytesStartAt ); // int charEndAt = translator.getCharIndex( bytesEndAt, charStartAt // ); for ( int[] range : translator.getCharIndexRanges( bytesStartAt, bytesEndAt ) ) { CHPX chpx = new CHPX( range[0], range[1], new SprmBuffer( getGrpprl( x ), 0 ) ); _chpxList.add( chpx ); } } }
/** * @deprecated Use {@link #toByteArray(CharIndexTranslator)} instead */ @Deprecated @SuppressWarnings( "unused" ) protected byte[] toByteArray(CharIndexTranslator translator, int fcMin) { return toByteArray( translator ); }
CHPFormattedDiskPage cfkp = new CHPFormattedDiskPage(); cfkp.fill(overflow); byte[] bufFkp = cfkp.toByteArray( translator ); wordDocumentStream.write(bufFkp); overflow = cfkp.getOverflow();
int pageOffset = POIFSConstants.SMALLER_BIG_BLOCK_SIZE * pageNum; CHPFormattedDiskPage cfkp = new CHPFormattedDiskPage(documentStream, pageOffset, tpt); for ( CHPX chpx : cfkp.getCHPXs() )
/** * Constructor used to read a binTable in from a Word document. * * @param documentStream The POIFS "WordDocument" stream from a Word document * @param offset The offset of the Chp bin table in the main stream. * @param size The size of the Chp bin table in the main stream. * @param fcMin The start of text in the main stream. */ public Word6CHPBinTable(byte[] documentStream, int offset, int size, int fcMin) { PlexOfCps binTable = new PlexOfCps(documentStream, offset, size, 2); int length = binTable.length(); for (int x = 0; x < length; x++) { GenericPropertyNode node = binTable.getProperty(x); int pageNum = LittleEndian.getShort((byte[])node.getBytes()); int pageOffset = POIFSConstants.BIG_BLOCK_SIZE * pageNum; CHPFormattedDiskPage cfkp = new CHPFormattedDiskPage(documentStream, pageOffset, fcMin); int fkpSize = cfkp.size(); for (int y = 0; y < fkpSize; y++) { _textRuns.add(cfkp.getCHPX(y)); } } }
CHPFormattedDiskPage cfkp = new CHPFormattedDiskPage(); cfkp.fill(overflow); byte[] bufFkp = cfkp.toByteArray( translator ); wordDocumentStream.write(bufFkp); overflow = cfkp.getOverflow();
int pageOffset = POIFSConstants.SMALLER_BIG_BLOCK_SIZE * pageNum; CHPFormattedDiskPage cfkp = new CHPFormattedDiskPage(documentStream, pageOffset, tpt); for ( CHPX chpx : cfkp.getCHPXs() )
int pageOffset = POIFSConstants.SMALLER_BIG_BLOCK_SIZE * pageNum; CHPFormattedDiskPage cfkp = new CHPFormattedDiskPage(documentStream, pageOffset, translator); for ( CHPX chpx : cfkp.getCHPXs() )
/** * This constructs a CHPFormattedDiskPage from a raw fkp (512 byte array * read from a Word file). */ public CHPFormattedDiskPage( byte[] documentStream, int offset, CharIndexTranslator translator ) { super( documentStream, offset ); for ( int x = 0; x < _crun; x++ ) { int bytesStartAt = getStart( x ); int bytesEndAt = getEnd( x ); // int charStartAt = translator.getCharIndex( bytesStartAt ); // int charEndAt = translator.getCharIndex( bytesEndAt, charStartAt // ); for ( int[] range : translator.getCharIndexRanges( bytesStartAt, bytesEndAt ) ) { CHPX chpx = new CHPX( range[0], range[1], new SprmBuffer( getGrpprl( x ), 0 ) ); _chpxList.add( chpx ); } } }
int pageOffset = POIFSConstants.SMALLER_BIG_BLOCK_SIZE * pageNum; CHPFormattedDiskPage cfkp = new CHPFormattedDiskPage(documentStream, pageOffset, translator); for ( CHPX chpx : cfkp.getCHPXs() )