Package org.apache.poi.ddf

Examples of org.apache.poi.ddf.EscherRecord.serialize()


        ShapeGroup group = null;
        EscherRecord opt = Shape.getEscherChild((EscherContainerRecord)spContainer.getChild(0), (short)0xF122);
        if(opt != null){
            try {
                EscherPropertyFactory f = new EscherPropertyFactory();
                List props = f.createProperties( opt.serialize(), 8, opt.getInstance() );
                EscherSimpleProperty p = (EscherSimpleProperty)props.get(0);
                if(p.getPropertyNumber() == 0x39F && p.getPropertyValue() == 1){
                    group = new Table(spContainer, parent);
                } else {
                    group = new ShapeGroup(spContainer, parent);
View Full Code Here


    protected static Record getClientDataRecord(EscherContainerRecord spContainer, int recordType) {
        Record oep = null;
        for (Iterator<EscherRecord> it = spContainer.getChildIterator(); it.hasNext();) {
            EscherRecord obj = it.next();
            if (obj.getRecordId() == EscherClientDataRecord.RECORD_ID) {
                byte[] data = obj.serialize();
                Record[] records = Record.findChildRecords(data, 8, data.length - 8);
                for (int j = 0; j < records.length; j++) {
                    if (records[j].getRecordType() == recordType) {
                        return records[j];
                    }
View Full Code Here

            int pos = offset + 4;
            for ( Iterator iterator = escherRecords.iterator(); iterator.hasNext(); )
            {
                EscherRecord r = (EscherRecord) iterator.next();
                pos += r.serialize( pos, data, new NullEscherSerializationListener() );
            }
        }
        return getRecordSize();
    }
View Full Code Here

            byte[] buffer = new byte[getRawDataSize()];
            int pos = 0;
            for ( Iterator iterator = getEscherRecords().iterator(); iterator.hasNext(); )
            {
                EscherRecord r = (EscherRecord) iterator.next();
                pos += r.serialize(pos, buffer, new NullEscherSerializationListener() );
            }

            return writeData( offset, data, buffer );
        }
    }
View Full Code Here

        assertEquals("data was not fully read", buffer.length, pos);

        // serialize to byte array
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        try {
            for(EscherRecord r : records) out.write(r.serialize());
        } catch (IOException e){
            throw new RuntimeException(e);
        }
        assertEquals(HexDump.toHex(buffer, 10), HexDump.toHex(out.toByteArray(), 10));
    }
View Full Code Here

        final List <Integer>spEndingOffsets = new ArrayList<Integer>();
        final List <EscherRecord> shapes = new ArrayList<EscherRecord>();
        int pos = 0;
        for (Object record : records) {
            EscherRecord e = (EscherRecord) record;
            pos += e.serialize(pos, buffer, new EscherSerializationListener() {
                public void beforeRecordSerialize(int offset, short recordId, EscherRecord record) {
                }

                public void afterRecordSerialize(int offset, short recordId, int size, EscherRecord record) {
                    if (recordId == EscherClientDataRecord.RECORD_ID || recordId == EscherTextboxRecord.RECORD_ID) {
View Full Code Here

            int pos = offset + 4;
            for ( Iterator iterator = escherRecords.iterator(); iterator.hasNext(); )
            {
                EscherRecord r = (EscherRecord) iterator.next();
                pos += r.serialize( pos, data, new NullEscherSerializationListener() );
            }
        }
        return getRecordSize();
    }
View Full Code Here

        final List shapes = new ArrayList();
        int pos = 0;
        for ( Iterator iterator = records.iterator(); iterator.hasNext(); )
        {
            EscherRecord e = (EscherRecord) iterator.next();
            pos += e.serialize( pos, buffer, new EscherSerializationListener()
            {
                public void beforeRecordSerialize( int offset, short recordId, EscherRecord record )
                {
                }
View Full Code Here

            int pos = offset + 4;
            for ( Iterator iterator = escherRecords.iterator(); iterator.hasNext(); )
            {
                EscherRecord r = (EscherRecord) iterator.next();
                pos += r.serialize( pos, data, new NullEscherSerializationListener() );
            }
        }
        return getRecordSize();
    }
View Full Code Here

            byte[] buffer = new byte[getRawDataSize()];
            int pos = 0;
            for ( Iterator iterator = getEscherRecords().iterator(); iterator.hasNext(); )
            {
                EscherRecord r = (EscherRecord) iterator.next();
                pos += r.serialize(pos, buffer, new NullEscherSerializationListener() );
            }

            return writeData( offset, data, buffer );
        }
    }
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.