Java Code Examples for org.omg.CORBA.portable.InputStream#read_long()

The following examples show how to use org.omg.CORBA.portable.InputStream#read_long() . 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: BootstrapResolverImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public java.util.Set list()
{
    InputStream inStream = null ;
    java.util.Set result = new java.util.HashSet() ;

    try {
        inStream = invoke( "list", null ) ;

        int count = inStream.read_long();
        for (int i=0; i < count; i++)
            result.add( inStream.read_string() ) ;

        // NOTE: do note trap and ignore errors.
        // Let them flow out.
    } finally {
        bootstrapDelegate.releaseReply( null, inStream ) ;
    }

    return result ;
}
 
Example 2
Source File: StubIORImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public StubIORImpl( org.omg.CORBA.Object obj )
{
    // write the IOR to an OutputStream and get an InputStream
    OutputStream ostr = StubAdapter.getORB( obj ).create_output_stream();
    ostr.write_Object(obj);
    InputStream istr = ostr.create_input_stream();

    // read the IOR components back from the stream
    int typeLength = istr.read_long();
    typeData = new byte[typeLength];
    istr.read_octet_array(typeData, 0, typeLength);
    int numProfiles = istr.read_long();
    profileTags = new int[numProfiles];
    profileData = new byte[numProfiles][];
    for (int i = 0; i < numProfiles; i++) {
        profileTags[i] = istr.read_long();
        profileData[i] = new byte[istr.read_long()];
        istr.read_octet_array(profileData[i], 0, profileData[i].length);
    }
}
 
Example 3
Source File: BootstrapResolverImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public java.util.Set list()
{
    InputStream inStream = null ;
    java.util.Set result = new java.util.HashSet() ;

    try {
        inStream = invoke( "list", null ) ;

        int count = inStream.read_long();
        for (int i=0; i < count; i++)
            result.add( inStream.read_string() ) ;

        // NOTE: do note trap and ignore errors.
        // Let them flow out.
    } finally {
        bootstrapDelegate.releaseReply( null, inStream ) ;
    }

    return result ;
}
 
Example 4
Source File: StubIORImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public StubIORImpl( org.omg.CORBA.Object obj )
{
    // write the IOR to an OutputStream and get an InputStream
    OutputStream ostr = StubAdapter.getORB( obj ).create_output_stream();
    ostr.write_Object(obj);
    InputStream istr = ostr.create_input_stream();

    // read the IOR components back from the stream
    int typeLength = istr.read_long();
    typeData = new byte[typeLength];
    istr.read_octet_array(typeData, 0, typeLength);
    int numProfiles = istr.read_long();
    profileTags = new int[numProfiles];
    profileData = new byte[numProfiles][];
    for (int i = 0; i < numProfiles; i++) {
        profileTags[i] = istr.read_long();
        profileData[i] = new byte[istr.read_long()];
        istr.read_octet_array(profileData[i], 0, profileData[i].length);
    }
}
 
Example 5
Source File: BootstrapResolverImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public java.util.Set list()
{
    InputStream inStream = null ;
    java.util.Set result = new java.util.HashSet() ;

    try {
        inStream = invoke( "list", null ) ;

        int count = inStream.read_long();
        for (int i=0; i < count; i++)
            result.add( inStream.read_string() ) ;

        // NOTE: do note trap and ignore errors.
        // Let them flow out.
    } finally {
        bootstrapDelegate.releaseReply( null, inStream ) ;
    }

    return result ;
}
 
Example 6
Source File: BootstrapResolverImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public java.util.Set list()
{
    InputStream inStream = null ;
    java.util.Set result = new java.util.HashSet() ;

    try {
        inStream = invoke( "list", null ) ;

        int count = inStream.read_long();
        for (int i=0; i < count; i++)
            result.add( inStream.read_string() ) ;

        // NOTE: do note trap and ignore errors.
        // Let them flow out.
    } finally {
        bootstrapDelegate.releaseReply( null, inStream ) ;
    }

    return result ;
}
 
Example 7
Source File: BootstrapResolverImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public java.util.Set list()
{
    InputStream inStream = null ;
    java.util.Set result = new java.util.HashSet() ;

    try {
        inStream = invoke( "list", null ) ;

        int count = inStream.read_long();
        for (int i=0; i < count; i++)
            result.add( inStream.read_string() ) ;

        // NOTE: do note trap and ignore errors.
        // Let them flow out.
    } finally {
        bootstrapDelegate.releaseReply( null, inStream ) ;
    }

    return result ;
}
 
Example 8
Source File: StubIORImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public StubIORImpl( org.omg.CORBA.Object obj )
{
    // write the IOR to an OutputStream and get an InputStream
    OutputStream ostr = StubAdapter.getORB( obj ).create_output_stream();
    ostr.write_Object(obj);
    InputStream istr = ostr.create_input_stream();

    // read the IOR components back from the stream
    int typeLength = istr.read_long();
    typeData = new byte[typeLength];
    istr.read_octet_array(typeData, 0, typeLength);
    int numProfiles = istr.read_long();
    profileTags = new int[numProfiles];
    profileData = new byte[numProfiles][];
    for (int i = 0; i < numProfiles; i++) {
        profileTags[i] = istr.read_long();
        profileData[i] = new byte[istr.read_long()];
        istr.read_octet_array(profileData[i], 0, profileData[i].length);
    }
}
 
Example 9
Source File: DynSequenceImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected boolean initializeComponentsFromAny() {
    // This typeCode is of kind tk_sequence.
    TypeCode typeCode = any.type();
    int length;
    TypeCode contentType = getContentType();
    InputStream input;

    try {
        input = any.create_input_stream();
    } catch (BAD_OPERATION e) {
        return false;
    }

    length = input.read_long();
    components = new DynAny[length];
    anys = new Any[length];

    for (int i=0; i<length; i++) {
        // _REVISIT_ Could use read_xxx_array() methods on InputStream for efficiency
        // but only for primitive types
        anys[i] = DynAnyUtil.extractAnyFromStream(contentType, input, orb);
        try {
            // Creates the appropriate subtype without copying the Any
            components[i] = DynAnyUtil.createMostDerivedDynAny(anys[i], orb, false);
        } catch (InconsistentTypeCode itc) { // impossible
        }
    }
    return true;
}
 
Example 10
Source File: DynSequenceImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected boolean initializeComponentsFromAny() {
    // This typeCode is of kind tk_sequence.
    TypeCode typeCode = any.type();
    int length;
    TypeCode contentType = getContentType();
    InputStream input;

    try {
        input = any.create_input_stream();
    } catch (BAD_OPERATION e) {
        return false;
    }

    length = input.read_long();
    components = new DynAny[length];
    anys = new Any[length];

    for (int i=0; i<length; i++) {
        // _REVISIT_ Could use read_xxx_array() methods on InputStream for efficiency
        // but only for primitive types
        anys[i] = DynAnyUtil.extractAnyFromStream(contentType, input, orb);
        try {
            // Creates the appropriate subtype without copying the Any
            components[i] = DynAnyUtil.createMostDerivedDynAny(anys[i], orb, false);
        } catch (InconsistentTypeCode itc) { // impossible
        }
    }
    return true;
}
 
Example 11
Source File: DynSequenceImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected boolean initializeComponentsFromAny() {
    // This typeCode is of kind tk_sequence.
    TypeCode typeCode = any.type();
    int length;
    TypeCode contentType = getContentType();
    InputStream input;

    try {
        input = any.create_input_stream();
    } catch (BAD_OPERATION e) {
        return false;
    }

    length = input.read_long();
    components = new DynAny[length];
    anys = new Any[length];

    for (int i=0; i<length; i++) {
        // _REVISIT_ Could use read_xxx_array() methods on InputStream for efficiency
        // but only for primitive types
        anys[i] = DynAnyUtil.extractAnyFromStream(contentType, input, orb);
        try {
            // Creates the appropriate subtype without copying the Any
            components[i] = DynAnyUtil.createMostDerivedDynAny(anys[i], orb, false);
        } catch (InconsistentTypeCode itc) { // impossible
        }
    }
    return true;
}
 
Example 12
Source File: DynSequenceImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected boolean initializeComponentsFromAny() {
    // This typeCode is of kind tk_sequence.
    TypeCode typeCode = any.type();
    int length;
    TypeCode contentType = getContentType();
    InputStream input;

    try {
        input = any.create_input_stream();
    } catch (BAD_OPERATION e) {
        return false;
    }

    length = input.read_long();
    components = new DynAny[length];
    anys = new Any[length];

    for (int i=0; i<length; i++) {
        // _REVISIT_ Could use read_xxx_array() methods on InputStream for efficiency
        // but only for primitive types
        anys[i] = DynAnyUtil.extractAnyFromStream(contentType, input, orb);
        try {
            // Creates the appropriate subtype without copying the Any
            components[i] = DynAnyUtil.createMostDerivedDynAny(anys[i], orb, false);
        } catch (InconsistentTypeCode itc) { // impossible
        }
    }
    return true;
}
 
Example 13
Source File: DynSequenceImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
protected boolean initializeComponentsFromAny() {
    // This typeCode is of kind tk_sequence.
    TypeCode typeCode = any.type();
    int length;
    TypeCode contentType = getContentType();
    InputStream input;

    try {
        input = any.create_input_stream();
    } catch (BAD_OPERATION e) {
        return false;
    }

    length = input.read_long();
    components = new DynAny[length];
    anys = new Any[length];

    for (int i=0; i<length; i++) {
        // _REVISIT_ Could use read_xxx_array() methods on InputStream for efficiency
        // but only for primitive types
        anys[i] = DynAnyUtil.extractAnyFromStream(contentType, input, orb);
        try {
            // Creates the appropriate subtype without copying the Any
            components[i] = DynAnyUtil.createMostDerivedDynAny(anys[i], orb, false);
        } catch (InconsistentTypeCode itc) { // impossible
        }
    }
    return true;
}
 
Example 14
Source File: CorbaObjectWriterTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Test
public void testWriteLong() {
    OutputStream oStream = orb.create_output_stream();

    CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
    Integer longValue = Integer.valueOf(-1234567);
    writer.writeLong(longValue);

    InputStream iStream = oStream.create_input_stream();
    int l = iStream.read_long();
    assertTrue(l == longValue.intValue());
}
 
Example 15
Source File: DynSequenceImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
protected boolean initializeComponentsFromAny() {
    // This typeCode is of kind tk_sequence.
    TypeCode typeCode = any.type();
    int length;
    TypeCode contentType = getContentType();
    InputStream input;

    try {
        input = any.create_input_stream();
    } catch (BAD_OPERATION e) {
        return false;
    }

    length = input.read_long();
    components = new DynAny[length];
    anys = new Any[length];

    for (int i=0; i<length; i++) {
        // _REVISIT_ Could use read_xxx_array() methods on InputStream for efficiency
        // but only for primitive types
        anys[i] = DynAnyUtil.extractAnyFromStream(contentType, input, orb);
        try {
            // Creates the appropriate subtype without copying the Any
            components[i] = DynAnyUtil.createMostDerivedDynAny(anys[i], orb, false);
        } catch (InconsistentTypeCode itc) { // impossible
        }
    }
    return true;
}
 
Example 16
Source File: IntHolder.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Reads unmarshalled data from <code>input</code> and assigns it to
 * the <code>value</code> field in this <code>IntHolder</code> object.
 *
 * @param input the <code>InputStream</code> object containing CDR
 *              formatted data from the wire
 */
public void _read(InputStream input) {
    value = input.read_long();
}
 
Example 17
Source File: IntHolder.java    From jdk1.8-source-analysis with Apache License 2.0 2 votes vote down vote up
/**
 * Reads unmarshalled data from <code>input</code> and assigns it to
 * the <code>value</code> field in this <code>IntHolder</code> object.
 *
 * @param input the <code>InputStream</code> object containing CDR
 *              formatted data from the wire
 */
public void _read(InputStream input) {
    value = input.read_long();
}
 
Example 18
Source File: IntHolder.java    From openjdk-jdk8u with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Reads unmarshalled data from <code>input</code> and assigns it to
 * the <code>value</code> field in this <code>IntHolder</code> object.
 *
 * @param input the <code>InputStream</code> object containing CDR
 *              formatted data from the wire
 */
public void _read(InputStream input) {
    value = input.read_long();
}
 
Example 19
Source File: IntHolder.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Reads unmarshalled data from <code>input</code> and assigns it to
 * the <code>value</code> field in this <code>IntHolder</code> object.
 *
 * @param input the <code>InputStream</code> object containing CDR
 *              formatted data from the wire
 */
public void _read(InputStream input) {
    value = input.read_long();
}
 
Example 20
Source File: IntHolder.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Reads unmarshalled data from <code>input</code> and assigns it to
 * the <code>value</code> field in this <code>IntHolder</code> object.
 *
 * @param input the <code>InputStream</code> object containing CDR
 *              formatted data from the wire
 */
public void _read(InputStream input) {
    value = input.read_long();
}