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;
}