Java Code Examples for com.sun.corba.se.impl.orbutil.ORBUtility#isForeignORB()

The following examples show how to use com.sun.corba.se.impl.orbutil.ORBUtility#isForeignORB() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CDROutputStream_1_0.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
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);
    }
}
 
Example 2
Source File: CDROutputStream_1_0.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example 3
Source File: CDROutputStream_1_0.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example 4
Source File: CDROutputStream_1_0.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
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);
    }
}
 
Example 5
Source File: CDROutputStream_1_0.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
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();
}
 
Example 6
Source File: CDRInputStream_1_0.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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));
    }
 
Example 7
Source File: CDRInputStream_1_0.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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));
    }
 
Example 8
Source File: CDROutputStream_1_0.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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();
}
 
Example 9
Source File: CDRInputStream_1_0.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 10
Source File: CDRInputStream_1_0.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 11
Source File: CDRInputStream_1_0.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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));
    }
 
Example 12
Source File: CDRInputStream_1_0.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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));
    }
 
Example 13
Source File: CDRInputStream_1_0.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 14
Source File: CDROutputStream_1_0.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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();
}
 
Example 15
Source File: CDRInputStream_1_0.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
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));
    }
 
Example 16
Source File: CDRInputStream_1_0.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
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);
}
 
Example 17
Source File: CDROutputStream_1_0.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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();
}
 
Example 18
Source File: CDROutputStream_1_0.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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();
}
 
Example 19
Source File: CDRInputStream_1_0.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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));
    }
 
Example 20
Source File: CDRInputStream_1_0.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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);
}