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 = thedata.length;LittleEndian.putInt(data, offset+4, remainingBytes);System.arraycopy(thedata, 0, data, offset+8, thedata.length);int pos = offset+8+thedata.length;listener.afterRecordSerialize( pos, getRecordId(), pos - offset, this );int size = pos - offset;if (size != getRecordSize()) {throw new RecordFormatException(size + " bytes written but getRecordSize() reports " + getRecordSize());}return size;}

public override int Serialize(int offset, byte[] data, EscherSerializationListener listener){listener.BeforeRecordSerialize(offset, RecordId, this);LittleEndian.PutShort(data, offset, Options);LittleEndian.PutShort(data, offset + 2, RecordId);int remainingBytes = _thedata.Length;LittleEndian.PutInt(data, offset + 4, remainingBytes);Array.Copy(_thedata, 0, data, offset + 8, _thedata.Length);int pos = offset + 8 + _thedata.Length;listener.AfterRecordSerialize(pos, RecordId, pos - offset, this);int size = pos - offset;if (size != RecordSize)throw new RecordFormatException(size + " bytes written but RecordSize reports " + RecordSize);return size;}
