本文整理汇总了Java中org.omg.IOP.TaggedComponentHelper类的典型用法代码示例。如果您正苦于以下问题:Java TaggedComponentHelper类的具体用法?Java TaggedComponentHelper怎么用?Java TaggedComponentHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TaggedComponentHelper类属于org.omg.IOP包,在下文中一共展示了TaggedComponentHelper类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addComponentTo
import org.omg.IOP.TaggedComponentHelper; //导入依赖的package包/类
/**
* Add given component to the given profile that is NOT an Internet profile.
*
* @param profile the profile, where the component should be added.
* @param component the component to add.
*/
private static void addComponentTo(TaggedProfile profile,
TaggedComponent component)
{
if (profile.tag == TAG_MULTIPLE_COMPONENTS.value)
{
TaggedComponent[] present;
if (profile.profile_data.length > 0)
{
BufferredCdrInput in = new BufferredCdrInput(profile.profile_data);
present = new TaggedComponent[in.read_long()];
for (int i = 0; i < present.length; i++)
{
present[i] = TaggedComponentHelper.read(in);
}
}
else
present = new TaggedComponent[0];
BufferedCdrOutput out = new BufferedCdrOutput(profile.profile_data.length
+ component.component_data.length
+ 8);
// Write new amount of components.
out.write_long(present.length + 1);
// Write other components.
for (int i = 0; i < present.length; i++)
TaggedComponentHelper.write(out, present[i]);
// Write the passed component.
TaggedComponentHelper.write(out, component);
try
{
out.close();
}
catch (IOException e)
{
throw new Unexpected(e);
}
profile.profile_data = out.buffer.toByteArray();
}
else
// The future supported tagged profiles should be added here.
throw new BAD_PARAM("Unsupported profile type " + profile.tag);
}