当前位置: 首页>>代码示例>>Java>>正文


Java ORBUtility.isForeignORB方法代码示例

本文整理汇总了Java中com.sun.corba.se.impl.orbutil.ORBUtility.isForeignORB方法的典型用法代码示例。如果您正苦于以下问题:Java ORBUtility.isForeignORB方法的具体用法?Java ORBUtility.isForeignORB怎么用?Java ORBUtility.isForeignORB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.corba.se.impl.orbutil.ORBUtility的用法示例。


在下文中一共展示了ORBUtility.isForeignORB方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: write_wchar

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
public void write_wchar(char x)
{
    // Don't allow transmission of wchar/wstring data with
    // foreign ORBs since it's against the spec.
    if (ORBUtility.isForeignORB(orb)) {
        throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE);
    }

    // If it's one of our legacy ORBs, do what they did:
    alignAndReserve(2, 2);

    if (littleEndian) {
        writeLittleEndianWchar(x);
    } else {
        writeBigEndianWchar(x);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:CDROutputStream_1_0.java

示例2: write_wstring

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
public void write_wstring(String value)
{
    if (value == null)
        throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE);

    // Don't allow transmission of wchar/wstring data with
    // foreign ORBs since it's against the spec.
    if (ORBUtility.isForeignORB(orb)) {
        throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE);
    }

    // When talking to our legacy ORBs, do what they did:
    int len = value.length() + 1;

    // This will only have an effect if we're already chunking
    handleSpecialChunkBegin(4 + (len * 2) + computeAlignment(4));

    write_long(len);

    for (int i = 0; i < len - 1; i++)
        write_wchar(value.charAt(i));

    // Write the null ending
    write_short((short)0);

    // This will only have an effect if we're already chunking
    handleSpecialChunkEnd();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:CDROutputStream_1_0.java

示例3: read_wchar

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
public char read_wchar() {

        // Don't allow transmission of wchar/wstring data with
        // foreign ORBs since it's against the spec.
        if (ORBUtility.isForeignORB((ORB)orb)) {
            throw wrapper.wcharDataInGiop10( CompletionStatus.COMPLETED_MAYBE);
        }

        // If we're talking to one of our legacy ORBs, do what
        // they did:
        int b1, b2;

        alignAndCheck(2, 2);

        if (littleEndian) {
            b2 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF;
            bbwi.position(bbwi.position() + 1);
            b1 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF;
            bbwi.position(bbwi.position() + 1);
        } else {
            b1 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF;
            bbwi.position(bbwi.position() + 1);
            b2 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF;
            bbwi.position(bbwi.position() + 1);
        }

        return (char)((b1 << 8) + (b2 << 0));
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:CDRInputStream_1_0.java

示例4: read_wstring

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
public String read_wstring() {
    // Don't allow transmission of wchar/wstring data with
    // foreign ORBs since it's against the spec.
    if (ORBUtility.isForeignORB((ORB)orb)) {
        throw wrapper.wcharDataInGiop10( CompletionStatus.COMPLETED_MAYBE);
    }

    int len = read_long();

    //
    // Workaround for ORBs which send string lengths of
    // zero to mean empty string.
    //
    //
    // IMPORTANT: Do not replace 'new String("")' with "", it may result
    // in a Serialization bug (See serialization.zerolengthstring) and
    // bug id: 4728756 for details
    if (len == 0)
        return new String("");

    checkForNegativeLength(len);

    len--;
    char[] c = new char[len];

    for (int i = 0; i < len; i++)
        c[i] = read_wchar();

    // skip the two null terminator bytes
    read_wchar();
    // bbwi.position(bbwi.position() + 2);

    return new String(c);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:CDRInputStream_1_0.java


注:本文中的com.sun.corba.se.impl.orbutil.ORBUtility.isForeignORB方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。