public byte[] encode(object data) { CdrEncapsulationOutputStream outputStream = new CdrEncapsulationOutputStream(m_version); m_serializerForAnyType.Serialize(data, outputStream); return(outputStream.GetEncapsulationData()); }
/// <summary> /// create an IOP service context from the code set service context /// </summary> /// <returns></returns> public omg.org.IOP.ServiceContext CreateServiceContext() { CdrEncapsulationOutputStream encapStream = new CdrEncapsulationOutputStream(GiopHeader.GetDefaultHeaderFlagsForPlatform()); encapStream.WriteULong((uint)m_charSet); encapStream.WriteULong((uint)m_wcharSet); return(new omg.org.IOP.ServiceContext(CodeSetService.SERVICE_ID, encapStream.GetEncapsulationData())); }
public byte[] encode_value(object data) { CdrEncapsulationOutputStream outputStream = new CdrEncapsulationOutputStream(m_version); if (!(data is Any)) { Serializer ser = m_serFactory.Create(data.GetType(), AttributeExtCollection.EmptyCollection); ser.Serialize(data, outputStream); } else { Type marshalAs = ((TypeCodeImpl)((Any)data).Type).GetClsForTypeCode(); AttributeExtCollection marshalAsAttrs = ((TypeCodeImpl)((Any)data).Type).GetClsAttributesForTypeCode(); Serializer ser = m_serFactory.Create(marshalAs, marshalAsAttrs); ser.Serialize(data, outputStream); } return(outputStream.GetEncapsulationData()); }
/// <summary> /// create an IOP service context from the code set service context /// </summary> /// <returns></returns> public omg.org.IOP.ServiceContext CreateServiceContext() { CdrEncapsulationOutputStream encapStream = new CdrEncapsulationOutputStream(GiopHeader.GetDefaultHeaderFlagsForPlatform()); encapStream.WriteULong((uint)m_charSet); encapStream.WriteULong((uint)m_wcharSet); return new omg.org.IOP.ServiceContext(CodeSetService.SERVICE_ID, encapStream.GetEncapsulationData()); }
public byte[] encode_value (object data) { CdrEncapsulationOutputStream outputStream = new CdrEncapsulationOutputStream(m_version); if (!(data is Any)) { Serializer ser = m_serFactory.Create(data.GetType(), AttributeExtCollection.EmptyCollection); ser.Serialize(data, outputStream); } else { Type marshalAs = ((TypeCodeImpl)((Any)data).Type).GetClsForTypeCode(); AttributeExtCollection marshalAsAttrs = ((TypeCodeImpl)((Any)data).Type).GetClsAttributesForTypeCode(); Serializer ser = m_serFactory.Create(marshalAs, marshalAsAttrs); ser.Serialize(data, outputStream); } return outputStream.GetEncapsulationData(); }
public byte[] encode (object data) { CdrEncapsulationOutputStream outputStream = new CdrEncapsulationOutputStream(m_version); m_serializerForAnyType.Serialize(data, outputStream); return outputStream.GetEncapsulationData(); }