*
* @return the raw security instance, not null
*/
public RawSecurity toRawSecurity() {
final FudgeContext context = OpenGammaFudgeContext.getInstance();
final MutableFudgeMsg fudgeMsg = context.newMessage();
final FudgeSerializer serializer = new FudgeSerializer(context);
populateFudgeMsg(serializer, fudgeMsg);
final RawSecurity security = new RawSecurity(getUniqueId(), getName(), getSecurityType(), getExternalIdBundle(), context.toByteArray(fudgeMsg));
security.setAttributes(getAttributes());
return security;