public FSPA getFspaFromCp( int cp ) { GenericPropertyNode propertyNode = _byStart.get( Integer.valueOf( cp ) ); if ( propertyNode == null ) { return null; } return new FSPA( propertyNode.getBytes(), 0 ); }
public PlexOfField( GenericPropertyNode propertyNode ) { this.propertyNode = propertyNode; fld = new FieldDescriptor( propertyNode.getBytes() ); }
public PlexOfField( GenericPropertyNode propertyNode ) { this.propertyNode = propertyNode; fld = new FieldDescriptor( propertyNode.getBytes() ); }
public FSPA getFspaFromCp( int cp ) { GenericPropertyNode propertyNode = _byStart.get( Integer.valueOf( cp ) ); if ( propertyNode == null ) { return null; } return new FSPA( propertyNode.getBytes(), 0 ); }
public FSPA[] getShapes() { List<FSPA> result = new ArrayList<>(_byStart.size()); for ( GenericPropertyNode propertyNode : _byStart.values() ) { result.add( new FSPA( propertyNode.getBytes(), 0 ) ); } return result.toArray( new FSPA[result.size()] ); }
public FSPA[] getShapes() { List<FSPA> result = new ArrayList<FSPA>( _byStart.size() ); for ( GenericPropertyNode propertyNode : _byStart.values() ) { result.add( new FSPA( propertyNode.getBytes(), 0 ) ); } return result.toArray( new FSPA[result.size()] ); }
public byte[] toByteArray() { int size = _props.size(); int cpBufSize = ( ( size + 1 ) * LittleEndian.INT_SIZE ); int structBufSize = +( _cbStruct * size ); int bufSize = cpBufSize + structBufSize; byte[] buf = new byte[bufSize]; GenericPropertyNode node = null; for ( int x = 0; x < size; x++ ) { node = _props.get( x ); // put the starting offset of the property into the plcf. LittleEndian.putInt( buf, ( LittleEndian.INT_SIZE * x ), node.getStart() ); // put the struct into the plcf System.arraycopy( node.getBytes(), 0, buf, cpBufSize + ( x * _cbStruct ), _cbStruct ); } // put the ending offset of the last property into the plcf. LittleEndian.putInt( buf, LittleEndian.INT_SIZE * size, node.getEnd() ); return buf; }
public byte[] toByteArray() { int size = _props.size(); int cpBufSize = ((size + 1) * LittleEndian.INT_SIZE); int structBufSize = +(_cbStruct * size); int bufSize = cpBufSize + structBufSize; byte[] buf = IOUtils.safelyAllocate(bufSize, MAX_RECORD_LENGTH); int nodeEnd = 0; for (int x = 0; x < size; x++) { GenericPropertyNode node = _props.get(x); nodeEnd = node.getEnd(); // put the starting offset of the property into the plcf. LittleEndian.putInt(buf, (LittleEndian.INT_SIZE * x), node.getStart()); // put the struct into the plcf System.arraycopy(node.getBytes(), 0, buf, cpBufSize + (x * _cbStruct), _cbStruct); } // put the ending offset of the last property into the plcf. LittleEndian.putInt(buf, LittleEndian.INT_SIZE * size, nodeEnd); return buf; }
int pageNum = LittleEndian.getInt( node.getBytes() ); int pageOffset = POIFSConstants.SMALLER_BIG_BLOCK_SIZE
public Shape(GenericPropertyNode nodo) { byte [] contenuto = nodo.getBytes(); _id = LittleEndian.getInt(contenuto); _left = LittleEndian.getInt(contenuto, 4); _top = LittleEndian.getInt(contenuto, 8); _right = LittleEndian.getInt(contenuto, 12); _bottom = LittleEndian.getInt(contenuto, 16); _inDoc = (_left >= 0 && _right >= 0 && _top >= 0 && _bottom >= 0); }
int pageNum = LittleEndian.getInt( node.getBytes() ); int pageOffset = POIFSConstants.SMALLER_BIG_BLOCK_SIZE * pageNum;
int pageNum = LittleEndian.getUShort(node.getBytes()); int pageOffset = POIFSConstants.SMALLER_BIG_BLOCK_SIZE * pageNum;
int pageNum = LittleEndian.getUShort(node.getBytes()); int pageOffset = POIFSConstants.SMALLER_BIG_BLOCK_SIZE * pageNum;
public OldPAPBinTable(byte[] documentStream, int offset, int size, int fcMin, TextPieceTable tpt) { 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.getUShort(node.getBytes()); int pageOffset = POIFSConstants.SMALLER_BIG_BLOCK_SIZE * pageNum; PAPFormattedDiskPage pfkp = new PAPFormattedDiskPage(documentStream, documentStream, pageOffset, tpt); for ( PAPX papx : pfkp.getPAPXs() ) { if ( papx != null ) _paragraphs.add( papx ); } } } }
public OldPAPBinTable(byte[] documentStream, int offset, int size, int fcMin, TextPieceTable tpt) { 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.getUShort(node.getBytes()); int pageOffset = POIFSConstants.SMALLER_BIG_BLOCK_SIZE * pageNum; PAPFormattedDiskPage pfkp = new PAPFormattedDiskPage(documentStream, documentStream, pageOffset, tpt); for ( PAPX papx : pfkp.getPAPXs() ) { if ( papx != null ) _paragraphs.add( papx ); } } } }
/** * 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)); } } }
SectionDescriptor sed = new SectionDescriptor(node.getBytes(), 0);
SectionDescriptor sed = new SectionDescriptor(node.getBytes(), 0);