Java Code Examples for com.sun.corba.se.impl.encoding.OSFCodeSetRegistry

The following examples show how to use com.sun.corba.se.impl.encoding.OSFCodeSetRegistry. These examples are extracted from open source projects. 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 Project: jdk1.8-source-analysis   Author: raysonfang   File: EncapsInputStream.java    License: Apache License 2.0 6 votes vote down vote up
protected CodeSetConversion.BTCConverter createWCharBTCConverter() {
    // Wide characters don't exist in GIOP 1.0
    if (getGIOPVersion().equals(GIOPVersion.V1_0))
        throw wrapper.wcharDataInGiop10( CompletionStatus.COMPLETED_MAYBE);

    // In GIOP 1.1, we shouldn't have byte order markers.  Take the order
    // of the stream if we don't see them.
    if (getGIOPVersion().equals(GIOPVersion.V1_1))
        return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.UTF_16,
                                                        isLittleEndian());

    // Assume anything else adheres to GIOP 1.2 requirements.
    //
    // Our UTF_16 converter will work with byte order markers, and if
    // they aren't present, it will use the provided endianness.
    //
    // With no byte order marker, it's big endian in GIOP 1.2.
    // formal 00-11-03 15.3.16.
    return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.UTF_16,
                                                    false);
}
 
Example #2
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: CDRInputObject.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Override the default CDR factory behavior to get the
 * negotiated code sets from the connection.
 *
 * These are only called once per message, the first time needed.
 *
 * In the local case, there is no Connection, so use the
 * local code sets.
 */
protected CodeSetConversion.BTCConverter createCharBTCConverter() {
    CodeSetComponentInfo.CodeSetContext codesets = getCodeSets();

    // If the connection doesn't have its negotiated
    // code sets by now, fall back on the defaults defined
    // in CDRInputStream.
    if (codesets == null)
        return super.createCharBTCConverter();

    OSFCodeSetRegistry.Entry charSet
        = OSFCodeSetRegistry.lookupEntry(codesets.getCharCodeSet());

    if (charSet == null)
        throw wrapper.unknownCodeset( charSet ) ;

    return CodeSetConversion.impl().getBTCConverter(charSet, isLittleEndian());
}
 
Example #3
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: CDROutputObject.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Override the default CDR factory behavior to get the
 * negotiated code sets from the connection.
 *
 * These are only called once per message, the first time needed.
 *
 * In the local case, there is no Connection, so use the
 * local code sets.
 */
protected CodeSetConversion.CTBConverter createCharCTBConverter() {
    CodeSetComponentInfo.CodeSetContext codesets = getCodeSets();

    // If the connection doesn't have its negotiated
    // code sets by now, fall back on the defaults defined
    // in CDRInputStream.
    if (codesets == null)
        return super.createCharCTBConverter();

    OSFCodeSetRegistry.Entry charSet
        = OSFCodeSetRegistry.lookupEntry(codesets.getCharCodeSet());

    if (charSet == null)
        throw wrapper.unknownCodeset( charSet ) ;

    return CodeSetConversion.impl().getCTBConverter(charSet,
                                                    isLittleEndian(),
                                                    false);
}
 
Example #4
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: EncapsOutputStream.java    License: Apache License 2.0 6 votes vote down vote up
protected CodeSetConversion.CTBConverter createWCharCTBConverter() {
    if (getGIOPVersion().equals(GIOPVersion.V1_0))
        throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE);

    // In the case of GIOP 1.1, we take the byte order of the stream and don't
    // use byte order markers since we're limited to a 2 byte fixed width encoding.
    if (getGIOPVersion().equals(GIOPVersion.V1_1))
        return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
                                                        isLittleEndian(),
                                                        false);

    // Assume anything else meets GIOP 1.2 requirements
    //
    // Use byte order markers?  If not, use big endian in GIOP 1.2.
    // (formal 00-11-03 15.3.16)

    boolean useBOM = ((ORB)orb()).getORBData().useByteOrderMarkersInEncapsulations();

    return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
                                                    false,
                                                    useBOM);
}
 
Example #5
Source Project: hottub   Author: dsrg-uoft   File: EncapsOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected CodeSetConversion.CTBConverter createWCharCTBConverter() {
    if (getGIOPVersion().equals(GIOPVersion.V1_0))
        throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE);

    // In the case of GIOP 1.1, we take the byte order of the stream and don't
    // use byte order markers since we're limited to a 2 byte fixed width encoding.
    if (getGIOPVersion().equals(GIOPVersion.V1_1))
        return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
                                                        isLittleEndian(),
                                                        false);

    // Assume anything else meets GIOP 1.2 requirements
    //
    // Use byte order markers?  If not, use big endian in GIOP 1.2.
    // (formal 00-11-03 15.3.16)

    boolean useBOM = ((ORB)orb()).getORBData().useByteOrderMarkersInEncapsulations();

    return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
                                                    false,
                                                    useBOM);
}
 
Example #6
Source Project: TencentKona-8   Author: Tencent   File: EncapsInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected CodeSetConversion.BTCConverter createWCharBTCConverter() {
    // Wide characters don't exist in GIOP 1.0
    if (getGIOPVersion().equals(GIOPVersion.V1_0))
        throw wrapper.wcharDataInGiop10( CompletionStatus.COMPLETED_MAYBE);

    // In GIOP 1.1, we shouldn't have byte order markers.  Take the order
    // of the stream if we don't see them.
    if (getGIOPVersion().equals(GIOPVersion.V1_1))
        return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.UTF_16,
                                                        isLittleEndian());

    // Assume anything else adheres to GIOP 1.2 requirements.
    //
    // Our UTF_16 converter will work with byte order markers, and if
    // they aren't present, it will use the provided endianness.
    //
    // With no byte order marker, it's big endian in GIOP 1.2.
    // formal 00-11-03 15.3.16.
    return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.UTF_16,
                                                    false);
}
 
Example #7
Source Project: openjdk-8-source   Author: keerath   File: CDRInputObject.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the default CDR factory behavior to get the
 * negotiated code sets from the connection.
 *
 * These are only called once per message, the first time needed.
 *
 * In the local case, there is no Connection, so use the
 * local code sets.
 */
protected CodeSetConversion.BTCConverter createCharBTCConverter() {
    CodeSetComponentInfo.CodeSetContext codesets = getCodeSets();

    // If the connection doesn't have its negotiated
    // code sets by now, fall back on the defaults defined
    // in CDRInputStream.
    if (codesets == null)
        return super.createCharBTCConverter();

    OSFCodeSetRegistry.Entry charSet
        = OSFCodeSetRegistry.lookupEntry(codesets.getCharCodeSet());

    if (charSet == null)
        throw wrapper.unknownCodeset( charSet ) ;

    return CodeSetConversion.impl().getBTCConverter(charSet, isLittleEndian());
}
 
Example #8
Source Project: TencentKona-8   Author: Tencent   File: CDROutputObject.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the default CDR factory behavior to get the
 * negotiated code sets from the connection.
 *
 * These are only called once per message, the first time needed.
 *
 * In the local case, there is no Connection, so use the
 * local code sets.
 */
protected CodeSetConversion.CTBConverter createCharCTBConverter() {
    CodeSetComponentInfo.CodeSetContext codesets = getCodeSets();

    // If the connection doesn't have its negotiated
    // code sets by now, fall back on the defaults defined
    // in CDRInputStream.
    if (codesets == null)
        return super.createCharCTBConverter();

    OSFCodeSetRegistry.Entry charSet
        = OSFCodeSetRegistry.lookupEntry(codesets.getCharCodeSet());

    if (charSet == null)
        throw wrapper.unknownCodeset( charSet ) ;

    return CodeSetConversion.impl().getCTBConverter(charSet,
                                                    isLittleEndian(),
                                                    false);
}
 
Example #9
Source Project: TencentKona-8   Author: Tencent   File: EncapsOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected CodeSetConversion.CTBConverter createWCharCTBConverter() {
    if (getGIOPVersion().equals(GIOPVersion.V1_0))
        throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE);

    // In the case of GIOP 1.1, we take the byte order of the stream and don't
    // use byte order markers since we're limited to a 2 byte fixed width encoding.
    if (getGIOPVersion().equals(GIOPVersion.V1_1))
        return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
                                                        isLittleEndian(),
                                                        false);

    // Assume anything else meets GIOP 1.2 requirements
    //
    // Use byte order markers?  If not, use big endian in GIOP 1.2.
    // (formal 00-11-03 15.3.16)

    boolean useBOM = ((ORB)orb()).getORBData().useByteOrderMarkersInEncapsulations();

    return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
                                                    false,
                                                    useBOM);
}
 
Example #10
Source Project: hottub   Author: dsrg-uoft   File: EncapsInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected CodeSetConversion.BTCConverter createWCharBTCConverter() {
    // Wide characters don't exist in GIOP 1.0
    if (getGIOPVersion().equals(GIOPVersion.V1_0))
        throw wrapper.wcharDataInGiop10( CompletionStatus.COMPLETED_MAYBE);

    // In GIOP 1.1, we shouldn't have byte order markers.  Take the order
    // of the stream if we don't see them.
    if (getGIOPVersion().equals(GIOPVersion.V1_1))
        return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.UTF_16,
                                                        isLittleEndian());

    // Assume anything else adheres to GIOP 1.2 requirements.
    //
    // Our UTF_16 converter will work with byte order markers, and if
    // they aren't present, it will use the provided endianness.
    //
    // With no byte order marker, it's big endian in GIOP 1.2.
    // formal 00-11-03 15.3.16.
    return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.UTF_16,
                                                    false);
}
 
Example #11
Source Project: jdk8u60   Author: chenghanpeng   File: EncapsInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected CodeSetConversion.BTCConverter createWCharBTCConverter() {
    // Wide characters don't exist in GIOP 1.0
    if (getGIOPVersion().equals(GIOPVersion.V1_0))
        throw wrapper.wcharDataInGiop10( CompletionStatus.COMPLETED_MAYBE);

    // In GIOP 1.1, we shouldn't have byte order markers.  Take the order
    // of the stream if we don't see them.
    if (getGIOPVersion().equals(GIOPVersion.V1_1))
        return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.UTF_16,
                                                        isLittleEndian());

    // Assume anything else adheres to GIOP 1.2 requirements.
    //
    // Our UTF_16 converter will work with byte order markers, and if
    // they aren't present, it will use the provided endianness.
    //
    // With no byte order marker, it's big endian in GIOP 1.2.
    // formal 00-11-03 15.3.16.
    return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.UTF_16,
                                                    false);
}
 
Example #12
Source Project: openjdk-8   Author: bpupadhyaya   File: EncapsOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected CodeSetConversion.CTBConverter createWCharCTBConverter() {
    if (getGIOPVersion().equals(GIOPVersion.V1_0))
        throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE);

    // In the case of GIOP 1.1, we take the byte order of the stream and don't
    // use byte order markers since we're limited to a 2 byte fixed width encoding.
    if (getGIOPVersion().equals(GIOPVersion.V1_1))
        return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
                                                        isLittleEndian(),
                                                        false);

    // Assume anything else meets GIOP 1.2 requirements
    //
    // Use byte order markers?  If not, use big endian in GIOP 1.2.
    // (formal 00-11-03 15.3.16)

    boolean useBOM = ((ORB)orb()).getORBData().useByteOrderMarkersInEncapsulations();

    return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
                                                    false,
                                                    useBOM);
}
 
Example #13
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: CDROutputObject.java    License: MIT License 6 votes vote down vote up
/**
 * Override the default CDR factory behavior to get the
 * negotiated code sets from the connection.
 *
 * These are only called once per message, the first time needed.
 *
 * In the local case, there is no Connection, so use the
 * local code sets.
 */
protected CodeSetConversion.CTBConverter createCharCTBConverter() {
    CodeSetComponentInfo.CodeSetContext codesets = getCodeSets();

    // If the connection doesn't have its negotiated
    // code sets by now, fall back on the defaults defined
    // in CDRInputStream.
    if (codesets == null)
        return super.createCharCTBConverter();

    OSFCodeSetRegistry.Entry charSet
        = OSFCodeSetRegistry.lookupEntry(codesets.getCharCodeSet());

    if (charSet == null)
        throw wrapper.unknownCodeset( charSet ) ;

    return CodeSetConversion.impl().getCTBConverter(charSet,
                                                    isLittleEndian(),
                                                    false);
}
 
Example #14
Source Project: hottub   Author: dsrg-uoft   File: CDRInputObject.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the default CDR factory behavior to get the
 * negotiated code sets from the connection.
 *
 * These are only called once per message, the first time needed.
 *
 * In the local case, there is no Connection, so use the
 * local code sets.
 */
protected CodeSetConversion.BTCConverter createCharBTCConverter() {
    CodeSetComponentInfo.CodeSetContext codesets = getCodeSets();

    // If the connection doesn't have its negotiated
    // code sets by now, fall back on the defaults defined
    // in CDRInputStream.
    if (codesets == null)
        return super.createCharBTCConverter();

    OSFCodeSetRegistry.Entry charSet
        = OSFCodeSetRegistry.lookupEntry(codesets.getCharCodeSet());

    if (charSet == null)
        throw wrapper.unknownCodeset( charSet ) ;

    return CodeSetConversion.impl().getBTCConverter(charSet, isLittleEndian());
}
 
Example #15
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: CDRInputObject.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the default CDR factory behavior to get the
 * negotiated code sets from the connection.
 *
 * These are only called once per message, the first time needed.
 *
 * In the local case, there is no Connection, so use the
 * local code sets.
 */
protected CodeSetConversion.BTCConverter createCharBTCConverter() {
    CodeSetComponentInfo.CodeSetContext codesets = getCodeSets();

    // If the connection doesn't have its negotiated
    // code sets by now, fall back on the defaults defined
    // in CDRInputStream.
    if (codesets == null)
        return super.createCharBTCConverter();

    OSFCodeSetRegistry.Entry charSet
        = OSFCodeSetRegistry.lookupEntry(codesets.getCharCodeSet());

    if (charSet == null)
        throw wrapper.unknownCodeset( charSet ) ;

    return CodeSetConversion.impl().getBTCConverter(charSet, isLittleEndian());
}
 
Example #16
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: EncapsOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected CodeSetConversion.CTBConverter createWCharCTBConverter() {
    if (getGIOPVersion().equals(GIOPVersion.V1_0))
        throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE);

    // In the case of GIOP 1.1, we take the byte order of the stream and don't
    // use byte order markers since we're limited to a 2 byte fixed width encoding.
    if (getGIOPVersion().equals(GIOPVersion.V1_1))
        return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
                                                        isLittleEndian(),
                                                        false);

    // Assume anything else meets GIOP 1.2 requirements
    //
    // Use byte order markers?  If not, use big endian in GIOP 1.2.
    // (formal 00-11-03 15.3.16)

    boolean useBOM = ((ORB)orb()).getORBData().useByteOrderMarkersInEncapsulations();

    return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
                                                    false,
                                                    useBOM);
}
 
Example #17
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: EncapsOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected CodeSetConversion.CTBConverter createWCharCTBConverter() {
    if (getGIOPVersion().equals(GIOPVersion.V1_0))
        throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE);

    // In the case of GIOP 1.1, we take the byte order of the stream and don't
    // use byte order markers since we're limited to a 2 byte fixed width encoding.
    if (getGIOPVersion().equals(GIOPVersion.V1_1))
        return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
                                                        isLittleEndian(),
                                                        false);

    // Assume anything else meets GIOP 1.2 requirements
    //
    // Use byte order markers?  If not, use big endian in GIOP 1.2.
    // (formal 00-11-03 15.3.16)

    boolean useBOM = ((ORB)orb()).getORBData().useByteOrderMarkersInEncapsulations();

    return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
                                                    false,
                                                    useBOM);
}
 
Example #18
Source Project: openjdk-8   Author: bpupadhyaya   File: CDRInputObject.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the default CDR factory behavior to get the
 * negotiated code sets from the connection.
 *
 * These are only called once per message, the first time needed.
 *
 * In the local case, there is no Connection, so use the
 * local code sets.
 */
protected CodeSetConversion.BTCConverter createCharBTCConverter() {
    CodeSetComponentInfo.CodeSetContext codesets = getCodeSets();

    // If the connection doesn't have its negotiated
    // code sets by now, fall back on the defaults defined
    // in CDRInputStream.
    if (codesets == null)
        return super.createCharBTCConverter();

    OSFCodeSetRegistry.Entry charSet
        = OSFCodeSetRegistry.lookupEntry(codesets.getCharCodeSet());

    if (charSet == null)
        throw wrapper.unknownCodeset( charSet ) ;

    return CodeSetConversion.impl().getBTCConverter(charSet, isLittleEndian());
}
 
Example #19
Source Project: hottub   Author: dsrg-uoft   File: CDROutputObject.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the default CDR factory behavior to get the
 * negotiated code sets from the connection.
 *
 * These are only called once per message, the first time needed.
 *
 * In the local case, there is no Connection, so use the
 * local code sets.
 */
protected CodeSetConversion.CTBConverter createCharCTBConverter() {
    CodeSetComponentInfo.CodeSetContext codesets = getCodeSets();

    // If the connection doesn't have its negotiated
    // code sets by now, fall back on the defaults defined
    // in CDRInputStream.
    if (codesets == null)
        return super.createCharCTBConverter();

    OSFCodeSetRegistry.Entry charSet
        = OSFCodeSetRegistry.lookupEntry(codesets.getCharCodeSet());

    if (charSet == null)
        throw wrapper.unknownCodeset( charSet ) ;

    return CodeSetConversion.impl().getCTBConverter(charSet,
                                                    isLittleEndian(),
                                                    false);
}
 
Example #20
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: EncapsInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected CodeSetConversion.BTCConverter createWCharBTCConverter() {
    // Wide characters don't exist in GIOP 1.0
    if (getGIOPVersion().equals(GIOPVersion.V1_0))
        throw wrapper.wcharDataInGiop10( CompletionStatus.COMPLETED_MAYBE);

    // In GIOP 1.1, we shouldn't have byte order markers.  Take the order
    // of the stream if we don't see them.
    if (getGIOPVersion().equals(GIOPVersion.V1_1))
        return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.UTF_16,
                                                        isLittleEndian());

    // Assume anything else adheres to GIOP 1.2 requirements.
    //
    // Our UTF_16 converter will work with byte order markers, and if
    // they aren't present, it will use the provided endianness.
    //
    // With no byte order marker, it's big endian in GIOP 1.2.
    // formal 00-11-03 15.3.16.
    return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.UTF_16,
                                                    false);
}
 
Example #21
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: CDROutputObject.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the default CDR factory behavior to get the
 * negotiated code sets from the connection.
 *
 * These are only called once per message, the first time needed.
 *
 * In the local case, there is no Connection, so use the
 * local code sets.
 */
protected CodeSetConversion.CTBConverter createCharCTBConverter() {
    CodeSetComponentInfo.CodeSetContext codesets = getCodeSets();

    // If the connection doesn't have its negotiated
    // code sets by now, fall back on the defaults defined
    // in CDRInputStream.
    if (codesets == null)
        return super.createCharCTBConverter();

    OSFCodeSetRegistry.Entry charSet
        = OSFCodeSetRegistry.lookupEntry(codesets.getCharCodeSet());

    if (charSet == null)
        throw wrapper.unknownCodeset( charSet ) ;

    return CodeSetConversion.impl().getCTBConverter(charSet,
                                                    isLittleEndian(),
                                                    false);
}
 
Example #22
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: CDRInputObject.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the default CDR factory behavior to get the
 * negotiated code sets from the connection.
 *
 * These are only called once per message, the first time needed.
 *
 * In the local case, there is no Connection, so use the
 * local code sets.
 */
protected CodeSetConversion.BTCConverter createCharBTCConverter() {
    CodeSetComponentInfo.CodeSetContext codesets = getCodeSets();

    // If the connection doesn't have its negotiated
    // code sets by now, fall back on the defaults defined
    // in CDRInputStream.
    if (codesets == null)
        return super.createCharBTCConverter();

    OSFCodeSetRegistry.Entry charSet
        = OSFCodeSetRegistry.lookupEntry(codesets.getCharCodeSet());

    if (charSet == null)
        throw wrapper.unknownCodeset( charSet ) ;

    return CodeSetConversion.impl().getBTCConverter(charSet, isLittleEndian());
}
 
Example #23
Source Project: openjdk-8   Author: bpupadhyaya   File: CDROutputObject.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Override the default CDR factory behavior to get the
 * negotiated code sets from the connection.
 *
 * These are only called once per message, the first time needed.
 *
 * In the local case, there is no Connection, so use the
 * local code sets.
 */
protected CodeSetConversion.CTBConverter createCharCTBConverter() {
    CodeSetComponentInfo.CodeSetContext codesets = getCodeSets();

    // If the connection doesn't have its negotiated
    // code sets by now, fall back on the defaults defined
    // in CDRInputStream.
    if (codesets == null)
        return super.createCharCTBConverter();

    OSFCodeSetRegistry.Entry charSet
        = OSFCodeSetRegistry.lookupEntry(codesets.getCharCodeSet());

    if (charSet == null)
        throw wrapper.unknownCodeset( charSet ) ;

    return CodeSetConversion.impl().getCTBConverter(charSet,
                                                    isLittleEndian(),
                                                    false);
}
 
Example #24
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: EncapsOutputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected CodeSetConversion.CTBConverter createWCharCTBConverter() {
    if (getGIOPVersion().equals(GIOPVersion.V1_0))
        throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE);

    // In the case of GIOP 1.1, we take the byte order of the stream and don't
    // use byte order markers since we're limited to a 2 byte fixed width encoding.
    if (getGIOPVersion().equals(GIOPVersion.V1_1))
        return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
                                                        isLittleEndian(),
                                                        false);

    // Assume anything else meets GIOP 1.2 requirements
    //
    // Use byte order markers?  If not, use big endian in GIOP 1.2.
    // (formal 00-11-03 15.3.16)

    boolean useBOM = ((ORB)orb()).getORBData().useByteOrderMarkersInEncapsulations();

    return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
                                                    false,
                                                    useBOM);
}
 
Example #25
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: EncapsInputStream.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected CodeSetConversion.BTCConverter createWCharBTCConverter() {
    // Wide characters don't exist in GIOP 1.0
    if (getGIOPVersion().equals(GIOPVersion.V1_0))
        throw wrapper.wcharDataInGiop10( CompletionStatus.COMPLETED_MAYBE);

    // In GIOP 1.1, we shouldn't have byte order markers.  Take the order
    // of the stream if we don't see them.
    if (getGIOPVersion().equals(GIOPVersion.V1_1))
        return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.UTF_16,
                                                        isLittleEndian());

    // Assume anything else adheres to GIOP 1.2 requirements.
    //
    // Our UTF_16 converter will work with byte order markers, and if
    // they aren't present, it will use the provided endianness.
    //
    // With no byte order marker, it's big endian in GIOP 1.2.
    // formal 00-11-03 15.3.16.
    return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.UTF_16,
                                                    false);
}
 
Example #26
Source Project: hottub   Author: dsrg-uoft   File: CDRInputObject.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected CodeSetConversion.BTCConverter createWCharBTCConverter() {

        CodeSetComponentInfo.CodeSetContext codesets = getCodeSets();

        // If the connection doesn't have its negotiated
        // code sets by now, we have to throw an exception.
        // See CORBA formal 00-11-03 13.9.2.6.
        if (codesets == null) {
            if (getConnection().isServer())
                throw omgWrapper.noClientWcharCodesetCtx() ;
            else
                throw omgWrapper.noServerWcharCodesetCmp() ;
        }

        OSFCodeSetRegistry.Entry wcharSet
            = OSFCodeSetRegistry.lookupEntry(codesets.getWCharCodeSet());

        if (wcharSet == null)
            throw wrapper.unknownCodeset( wcharSet ) ;

        // For GIOP 1.2 and UTF-16, use big endian if there is no byte
        // order marker.  (See issue 3405b)
        //
        // For GIOP 1.1 and UTF-16, use the byte order the stream if
        // there isn't (and there shouldn't be) a byte order marker.
        //
        // GIOP 1.0 doesn't have wchars.  If we're talking to a legacy ORB,
        // we do what our old ORBs did.
        if (wcharSet == OSFCodeSetRegistry.UTF_16) {
            if (getGIOPVersion().equals(GIOPVersion.V1_2))
                return CodeSetConversion.impl().getBTCConverter(wcharSet, false);
        }

        return CodeSetConversion.impl().getBTCConverter(wcharSet, isLittleEndian());
    }
 
Example #27
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: SocketOrChannelConnectionImpl.java    License: Apache License 2.0 5 votes vote down vote up
public synchronized void setCodeSetContext(CodeSetComponentInfo.CodeSetContext csc) {
    // Double check whether or not we need to do this
    if (codeSetContext == null) {

        if (OSFCodeSetRegistry.lookupEntry(csc.getCharCodeSet()) == null ||
            OSFCodeSetRegistry.lookupEntry(csc.getWCharCodeSet()) == null) {
            // If the client says it's negotiated a code set that
            // isn't a fallback and we never said we support, then
            // it has a bug.
            throw wrapper.badCodesetsFromClient() ;
        }

        codeSetContext = csc;
    }
}
 
Example #28
Source Project: openjdk-8   Author: bpupadhyaya   File: SocketOrChannelConnectionImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public synchronized void setCodeSetContext(CodeSetComponentInfo.CodeSetContext csc) {
    // Double check whether or not we need to do this
    if (codeSetContext == null) {

        if (OSFCodeSetRegistry.lookupEntry(csc.getCharCodeSet()) == null ||
            OSFCodeSetRegistry.lookupEntry(csc.getWCharCodeSet()) == null) {
            // If the client says it's negotiated a code set that
            // isn't a fallback and we never said we support, then
            // it has a bug.
            throw wrapper.badCodesetsFromClient() ;
        }

        codeSetContext = csc;
    }
}
 
Example #29
Source Project: TencentKona-8   Author: Tencent   File: CDRInputObject.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected CodeSetConversion.BTCConverter createWCharBTCConverter() {

        CodeSetComponentInfo.CodeSetContext codesets = getCodeSets();

        // If the connection doesn't have its negotiated
        // code sets by now, we have to throw an exception.
        // See CORBA formal 00-11-03 13.9.2.6.
        if (codesets == null) {
            if (getConnection().isServer())
                throw omgWrapper.noClientWcharCodesetCtx() ;
            else
                throw omgWrapper.noServerWcharCodesetCmp() ;
        }

        OSFCodeSetRegistry.Entry wcharSet
            = OSFCodeSetRegistry.lookupEntry(codesets.getWCharCodeSet());

        if (wcharSet == null)
            throw wrapper.unknownCodeset( wcharSet ) ;

        // For GIOP 1.2 and UTF-16, use big endian if there is no byte
        // order marker.  (See issue 3405b)
        //
        // For GIOP 1.1 and UTF-16, use the byte order the stream if
        // there isn't (and there shouldn't be) a byte order marker.
        //
        // GIOP 1.0 doesn't have wchars.  If we're talking to a legacy ORB,
        // we do what our old ORBs did.
        if (wcharSet == OSFCodeSetRegistry.UTF_16) {
            if (getGIOPVersion().equals(GIOPVersion.V1_2))
                return CodeSetConversion.impl().getBTCConverter(wcharSet, false);
        }

        return CodeSetConversion.impl().getBTCConverter(wcharSet, isLittleEndian());
    }
 
Example #30
Source Project: jdk8u60   Author: chenghanpeng   File: SocketOrChannelConnectionImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public synchronized void setCodeSetContext(CodeSetComponentInfo.CodeSetContext csc) {
    // Double check whether or not we need to do this
    if (codeSetContext == null) {

        if (OSFCodeSetRegistry.lookupEntry(csc.getCharCodeSet()) == null ||
            OSFCodeSetRegistry.lookupEntry(csc.getWCharCodeSet()) == null) {
            // If the client says it's negotiated a code set that
            // isn't a fallback and we never said we support, then
            // it has a bug.
            throw wrapper.badCodesetsFromClient() ;
        }

        codeSetContext = csc;
    }
}