public int serialize(int offset, byte[] data, EscherSerializationListener listener) {
    listener.beforeRecordSerialize(offset, getRecordId(), this);

    int pos = offset;
    LittleEndian.putShort(data, pos, getOptions());
    pos += 2;
    LittleEndian.putShort(data, pos, getRecordId());
    pos += 2;
    int remainingBytes = getRecordSize() - 8;
    LittleEndian.putInt(data, pos, remainingBytes);
    pos += 4;

    LittleEndian.putInt(data, pos, field_1_shapeIdMax);
    pos += 4;
    LittleEndian.putInt(data, pos, getNumIdClusters());
    pos += 4;
    LittleEndian.putInt(data, pos, field_3_numShapesSaved);
    pos += 4;
    LittleEndian.putInt(data, pos, field_4_drawingsSaved);
    pos += 4;
    for (int i = 0; i < field_5_fileIdClusters.length; i++) {
      LittleEndian.putInt(data, pos, field_5_fileIdClusters[i].field_1_drawingGroupId);
      pos += 4;
      LittleEndian.putInt(data, pos, field_5_fileIdClusters[i].field_2_numShapeIdsUsed);
      pos += 4;
    }

    listener.afterRecordSerialize(pos, getRecordId(), getRecordSize(), this);
    return getRecordSize();
  }
  public int serialize(int offset, byte[] data, EscherSerializationListener listener) {
    listener.beforeRecordSerialize(offset, getRecordId(), this);

    LittleEndian.putShort(data, offset, getOptions());
    LittleEndian.putShort(data, offset + 2, getRecordId());

    System.arraycopy(field_pictureData, 0, data, offset + 4, field_pictureData.length);

    listener.afterRecordSerialize(
        offset + 4 + field_pictureData.length, getRecordId(), field_pictureData.length + 4, this);
    return field_pictureData.length + 4;
  }
  public int serialize(int offset, byte[] data, EscherSerializationListener listener) {
    listener.beforeRecordSerialize(offset, getRecordId(), this);

    if (remainingData == null) remainingData = new byte[0];
    LittleEndian.putShort(data, offset, getOptions());
    LittleEndian.putShort(data, offset + 2, getRecordId());
    LittleEndian.putInt(data, offset + 4, remainingData.length);
    System.arraycopy(remainingData, 0, data, offset + 8, remainingData.length);
    int pos = offset + 8 + remainingData.length;

    listener.afterRecordSerialize(pos, getRecordId(), pos - offset, this);
    return pos - offset;
  }
Example #4
0
 public int serialize(int offset, byte[] data, EscherSerializationListener listener) {
   listener.beforeRecordSerialize(offset, getRecordId(), this);
   LittleEndian.putShort(data, offset, getOptions());
   LittleEndian.putShort(data, offset + 2, getRecordId());
   int remainingBytes = 16;
   LittleEndian.putInt(data, offset + 4, remainingBytes);
   LittleEndian.putInt(data, offset + 8, field_1_rectX1);
   LittleEndian.putInt(data, offset + 12, field_2_rectY1);
   LittleEndian.putInt(data, offset + 16, field_3_rectX2);
   LittleEndian.putInt(data, offset + 20, field_4_rectY2);
   //        System.arraycopy( remainingData, 0, data, offset + 26, remainingData.length );
   //        int pos = offset + 8 + 18 + remainingData.length;
   listener.afterRecordSerialize(
       offset + getRecordSize(), getRecordId(), offset + getRecordSize(), this);
   return 8 + 16;
 }