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

The following are top voted examples for showing how to use com.sun.corba.se.impl.encoding.EncapsOutputStream. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OpenJSharp   File: CorbaMessageMediatorImpl.java   Source Code and License 6 votes vote down vote up
private void addExceptionDetailMessage(CorbaMessageMediator mediator,
                                       SystemException ex,
                                       ServiceContexts serviceContexts)
{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos);
    ex.printStackTrace(pw);
    pw.flush(); // NOTE: you must flush or baos will be empty.
    EncapsOutputStream encapsOutputStream =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)mediator.getBroker());
    encapsOutputStream.putEndian();
    encapsOutputStream.write_wstring(baos.toString());
    UnknownServiceContext serviceContext =
        new UnknownServiceContext(ExceptionDetailMessage.value,
                                  encapsOutputStream.toByteArray());
    serviceContexts.put(serviceContext);
}
 
Example 2
Project: openjdk-jdk10   File: CorbaMessageMediatorImpl.java   Source Code and License 6 votes vote down vote up
private void addExceptionDetailMessage(CorbaMessageMediator mediator,
                                       SystemException ex,
                                       ServiceContexts serviceContexts)
{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos);
    ex.printStackTrace(pw);
    pw.flush(); // NOTE: you must flush or baos will be empty.
    EncapsOutputStream encapsOutputStream =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)mediator.getBroker());
    encapsOutputStream.putEndian();
    encapsOutputStream.write_wstring(baos.toString());
    UnknownServiceContext serviceContext =
        new UnknownServiceContext(ExceptionDetailMessage.value,
                                  encapsOutputStream.toByteArray());
    serviceContexts.put(serviceContext);
}
 
Example 3
Project: openjdk9   File: CorbaMessageMediatorImpl.java   Source Code and License 6 votes vote down vote up
private void addExceptionDetailMessage(CorbaMessageMediator mediator,
                                       SystemException ex,
                                       ServiceContexts serviceContexts)
{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos);
    ex.printStackTrace(pw);
    pw.flush(); // NOTE: you must flush or baos will be empty.
    EncapsOutputStream encapsOutputStream =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)mediator.getBroker());
    encapsOutputStream.putEndian();
    encapsOutputStream.write_wstring(baos.toString());
    UnknownServiceContext serviceContext =
        new UnknownServiceContext(ExceptionDetailMessage.value,
                                  encapsOutputStream.toByteArray());
    serviceContexts.put(serviceContext);
}
 
Example 4
Project: lookaside_java-1.8.0-openjdk   File: CorbaMessageMediatorImpl.java   Source Code and License 6 votes vote down vote up
private void addExceptionDetailMessage(CorbaMessageMediator mediator,
                                       SystemException ex,
                                       ServiceContexts serviceContexts)
{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos);
    ex.printStackTrace(pw);
    pw.flush(); // NOTE: you must flush or baos will be empty.
    EncapsOutputStream encapsOutputStream =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)mediator.getBroker());
    encapsOutputStream.putEndian();
    encapsOutputStream.write_wstring(baos.toString());
    UnknownServiceContext serviceContext =
        new UnknownServiceContext(ExceptionDetailMessage.value,
                                  encapsOutputStream.toByteArray());
    serviceContexts.put(serviceContext);
}
 
Example 5
Project: jdk8u_corba   File: CorbaMessageMediatorImpl.java   Source Code and License 6 votes vote down vote up
private void addExceptionDetailMessage(CorbaMessageMediator mediator,
                                       SystemException ex,
                                       ServiceContexts serviceContexts)
{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos);
    ex.printStackTrace(pw);
    pw.flush(); // NOTE: you must flush or baos will be empty.
    EncapsOutputStream encapsOutputStream =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)mediator.getBroker());
    encapsOutputStream.putEndian();
    encapsOutputStream.write_wstring(baos.toString());
    UnknownServiceContext serviceContext =
        new UnknownServiceContext(ExceptionDetailMessage.value,
                                  encapsOutputStream.toByteArray());
    serviceContexts.put(serviceContext);
}
 
Example 6
Project: infobip-open-jdk-8   File: CorbaMessageMediatorImpl.java   Source Code and License 6 votes vote down vote up
private void addExceptionDetailMessage(CorbaMessageMediator mediator,
                                       SystemException ex,
                                       ServiceContexts serviceContexts)
{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos);
    ex.printStackTrace(pw);
    pw.flush(); // NOTE: you must flush or baos will be empty.
    EncapsOutputStream encapsOutputStream =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)mediator.getBroker());
    encapsOutputStream.putEndian();
    encapsOutputStream.write_wstring(baos.toString());
    UnknownServiceContext serviceContext =
        new UnknownServiceContext(ExceptionDetailMessage.value,
                                  encapsOutputStream.toByteArray());
    serviceContexts.put(serviceContext);
}
 
Example 7
Project: openjdk-source-code-learn   File: CorbaMessageMediatorImpl.java   Source Code and License 6 votes vote down vote up
private void addExceptionDetailMessage(CorbaMessageMediator mediator,
                                       SystemException ex,
                                       ServiceContexts serviceContexts)
{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos);
    ex.printStackTrace(pw);
    pw.flush(); // NOTE: you must flush or baos will be empty.
    EncapsOutputStream encapsOutputStream =
        new EncapsOutputStream((ORB)mediator.getBroker());
    encapsOutputStream.putEndian();
    encapsOutputStream.write_wstring(baos.toString());
    UnknownServiceContext serviceContext =
        new UnknownServiceContext(ExceptionDetailMessage.value,
                                  encapsOutputStream.toByteArray());
    serviceContexts.put(serviceContext);
}
 
Example 8
Project: openjdk-source-code-learn   File: IORImpl.java   Source Code and License 6 votes vote down vote up
public String stringify()
{
    StringWriter bs;

    MarshalOutputStream s = new EncapsOutputStream(factory);
    s.putEndian();
    write( (OutputStream)s );
    bs = new StringWriter();
    try {
        s.writeTo(new HexOutputStream(bs));
    } catch (IOException ex) {
        throw wrapper.stringifyWriteError( ex ) ;
    }

    return ORBConstants.STRINGIFY_PREFIX + bs;
}
 
Example 9
Project: openjdk-source-code-learn   File: IIOPProfileTemplateImpl.java   Source Code and License 6 votes vote down vote up
public void write( ObjectKeyTemplate okeyTemplate, ObjectId id, OutputStream os)
{
    giopVersion.write( os ) ;
    primary.write( os ) ;

    // Note that this is NOT an encapsulation: do not marshal
    // the endianness flag.  However, the length is required.
    // Note that this cannot be accomplished with a codec!

    // Use the byte order of the given stream
    OutputStream encapsulatedOS = new EncapsOutputStream( (ORB)os.orb(),
        ((CDROutputStream)os).isLittleEndian() ) ;

    okeyTemplate.write( id, encapsulatedOS ) ;
    EncapsulationUtility.writeOutputStream( encapsulatedOS, os ) ;

    if (giopVersion.getMinor() > 0)
        EncapsulationUtility.writeIdentifiableSequence( this, os ) ;
}
 
Example 10
Project: OLD-OpenJDK8   File: CorbaMessageMediatorImpl.java   Source Code and License 6 votes vote down vote up
private void addExceptionDetailMessage(CorbaMessageMediator mediator,
                                       SystemException ex,
                                       ServiceContexts serviceContexts)
{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos);
    ex.printStackTrace(pw);
    pw.flush(); // NOTE: you must flush or baos will be empty.
    EncapsOutputStream encapsOutputStream =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)mediator.getBroker());
    encapsOutputStream.putEndian();
    encapsOutputStream.write_wstring(baos.toString());
    UnknownServiceContext serviceContext =
        new UnknownServiceContext(ExceptionDetailMessage.value,
                                  encapsOutputStream.toByteArray());
    serviceContexts.put(serviceContext);
}
 
Example 11
Project: openjdk-orb   File: CorbaMessageMediatorImpl.java   Source Code and License 6 votes vote down vote up
private void addExceptionDetailMessage(CorbaMessageMediator mediator,
                                       SystemException ex,
                                       ServiceContexts serviceContexts)
{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos);
    ex.printStackTrace(pw);
    pw.flush(); // NOTE: you must flush or baos will be empty.
    EncapsOutputStream encapsOutputStream =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)mediator.getBroker());
    encapsOutputStream.putEndian();
    encapsOutputStream.write_wstring(baos.toString());
    UnknownServiceContext serviceContext =
        new UnknownServiceContext(ExceptionDetailMessage.value,
                                  encapsOutputStream.toByteArray());
    serviceContexts.put(serviceContext);
}
 
Example 12
Project: openjdk-icedtea7   File: CorbaMessageMediatorImpl.java   Source Code and License 6 votes vote down vote up
private void addExceptionDetailMessage(CorbaMessageMediator mediator,
                                       SystemException ex,
                                       ServiceContexts serviceContexts)
{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintWriter pw = new PrintWriter(baos);
    ex.printStackTrace(pw);
    pw.flush(); // NOTE: you must flush or baos will be empty.
    EncapsOutputStream encapsOutputStream =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)mediator.getBroker());
    encapsOutputStream.putEndian();
    encapsOutputStream.write_wstring(baos.toString());
    UnknownServiceContext serviceContext =
        new UnknownServiceContext(ExceptionDetailMessage.value,
                                  encapsOutputStream.toByteArray());
    serviceContexts.put(serviceContext);
}
 
Example 13
Project: OpenJSharp   File: OutputStreamFactory.java   Source Code and License 5 votes vote down vote up
public static EncapsOutputStream newEncapsOutputStream(
        final ORB orb) {
    return AccessController.doPrivileged(
        new PrivilegedAction<EncapsOutputStream>() {
            @Override
            public EncapsOutputStream run() {
                return new EncapsOutputStream(
                    (com.sun.corba.se.spi.orb.ORB)orb);
            }
    });
}
 
Example 14
Project: OpenJSharp   File: OutputStreamFactory.java   Source Code and License 5 votes vote down vote up
public static EncapsOutputStream newEncapsOutputStream(
        final ORB orb, final GIOPVersion giopVersion) {
    return AccessController.doPrivileged(
        new PrivilegedAction<EncapsOutputStream>() {
            @Override
            public EncapsOutputStream run() {
                return new EncapsOutputStream(
                    (com.sun.corba.se.spi.orb.ORB)orb, giopVersion);
            }
    });
}
 
Example 15
Project: OpenJSharp   File: OutputStreamFactory.java   Source Code and License 5 votes vote down vote up
public static EncapsOutputStream newEncapsOutputStream(
        final ORB orb, final boolean isLittleEndian) {
    return AccessController.doPrivileged(
        new PrivilegedAction<EncapsOutputStream>() {
            @Override
            public EncapsOutputStream run() {
                return new EncapsOutputStream(
                    (com.sun.corba.se.spi.orb.ORB)orb, isLittleEndian);
            }
    });
}
 
Example 16
Project: OpenJSharp   File: ServiceContext.java   Source Code and License 5 votes vote down vote up
/** Write the service context to an output stream.  This method
 * must be used for writing the service context to a request or reply
 * header.
 */
public void write(OutputStream s, GIOPVersion gv) throws SystemException
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)(s.orb()), gv);
    os.putEndian() ;
    writeData( os ) ;
    byte[] data = os.toByteArray() ;

    s.write_long(getId());
    s.write_long(data.length);
    s.write_octet_array(data, 0, data.length);
}
 
Example 17
Project: OpenJSharp   File: TaggedComponentBase.java   Source Code and License 5 votes vote down vote up
public org.omg.IOP.TaggedComponent getIOPComponent(
    org.omg.CORBA.ORB orb )
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb);
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream() ) ;
    return org.omg.IOP.TaggedComponentHelper.read( is ) ;
}
 
Example 18
Project: OpenJSharp   File: CDREncapsCodec.java   Source Code and License 5 votes vote down vote up
/**
 * Convert the given any into a CDR encapsulated octet sequence.
 * If sendTypeCode is true, the type code is sent with the message, as in
 * a standard encapsulation.  If it is false, only the data is sent.
 * Either way, the endian type is sent as the first part of the message.
 */
private byte[] encodeImpl( Any data, boolean sendTypeCode )
    throws InvalidTypeForEncoding
{
    if( data == null )
        throw wrapper.nullParam() ;

    // _REVISIT_ Note that InvalidTypeForEncoding is never thrown in
    // the body of this method.  This is due to the fact that CDR*Stream
    // will never throw an exception if the encoding is invalid.  To
    // fix this, the CDROutputStream must know the version of GIOP it
    // is encoding for and it must check to ensure that, for example,
    // wstring cannot be encoded in GIOP 1.0.
    //
    // As part of the GIOP 1.2 work, the CDRInput and OutputStream will
    // be versioned.  This can be handled once this work is complete.

    // Create output stream with default endianness.
    EncapsOutputStream cdrOut =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(
        (com.sun.corba.se.spi.orb.ORB)orb, giopVersion );

    // This is an encapsulation, so put out the endian:
    cdrOut.putEndian();

    // Sometimes encode type code:
    if( sendTypeCode ) {
        cdrOut.write_TypeCode( data.type() );
    }

    // Encode value and return.
    data.write_value( cdrOut );

    return cdrOut.toByteArray();
}
 
Example 19
Project: OpenJSharp   File: EncapsulationUtility.java   Source Code and License 5 votes vote down vote up
static public void writeEncapsulation( WriteContents obj,
    OutputStream os )
{
    EncapsOutputStream out =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)os.orb());

    out.putEndian() ;

    obj.writeContents( out ) ;

    writeOutputStream( out, os ) ;
}
 
Example 20
Project: OpenJSharp   File: GenericTaggedProfile.java   Source Code and License 5 votes vote down vote up
public org.omg.IOP.TaggedProfile getIOPProfile()
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(orb);
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream()) ;
    return org.omg.IOP.TaggedProfileHelper.read( is ) ;
}
 
Example 21
Project: OpenJSharp   File: ObjectKeyImpl.java   Source Code and License 5 votes vote down vote up
public byte[] getBytes( org.omg.CORBA.ORB orb )
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb);
    write( os ) ;
    return os.toByteArray() ;
}
 
Example 22
Project: OpenJSharp   File: TaggedComponentFactoryFinderImpl.java   Source Code and License 5 votes vote down vote up
public TaggedComponent create( org.omg.CORBA.ORB orb,
    org.omg.IOP.TaggedComponent comp )
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb);
    org.omg.IOP.TaggedComponentHelper.write( os, comp ) ;
    InputStream is = (InputStream)(os.create_input_stream() ) ;
    // Skip the component ID: we just wrote it out above
    is.read_ulong() ;

    return (TaggedComponent)create( comp.tag, is ) ;
}
 
Example 23
Project: OpenJSharp   File: IORImpl.java   Source Code and License 5 votes vote down vote up
public org.omg.IOP.IOR getIOPIOR() {
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(factory);
    write(os);
    InputStream is = (InputStream) (os.create_input_stream());
    return org.omg.IOP.IORHelper.read(is);
}
 
Example 24
Project: OpenJSharp   File: IIOPProfileImpl.java   Source Code and License 5 votes vote down vote up
public org.omg.IOP.TaggedProfile getIOPProfile()
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(orb);
    os.write_long( getId() ) ;
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream()) ;
    return org.omg.IOP.TaggedProfileHelper.read( is ) ;
}
 
Example 25
Project: openjdk-jdk10   File: OutputStreamFactory.java   Source Code and License 5 votes vote down vote up
public static EncapsOutputStream newEncapsOutputStream(
        final ORB orb) {
    return AccessController.doPrivileged(
        new PrivilegedAction<EncapsOutputStream>() {
            @Override
            public EncapsOutputStream run() {
                return new EncapsOutputStream(
                    (com.sun.corba.se.spi.orb.ORB)orb);
            }
    });
}
 
Example 26
Project: openjdk-jdk10   File: OutputStreamFactory.java   Source Code and License 5 votes vote down vote up
public static EncapsOutputStream newEncapsOutputStream(
        final ORB orb, final GIOPVersion giopVersion) {
    return AccessController.doPrivileged(
        new PrivilegedAction<EncapsOutputStream>() {
            @Override
            public EncapsOutputStream run() {
                return new EncapsOutputStream(
                    (com.sun.corba.se.spi.orb.ORB)orb, giopVersion);
            }
    });
}
 
Example 27
Project: openjdk-jdk10   File: OutputStreamFactory.java   Source Code and License 5 votes vote down vote up
public static EncapsOutputStream newEncapsOutputStream(
        final ORB orb, final boolean isLittleEndian) {
    return AccessController.doPrivileged(
        new PrivilegedAction<EncapsOutputStream>() {
            @Override
            public EncapsOutputStream run() {
                return new EncapsOutputStream(
                    (com.sun.corba.se.spi.orb.ORB)orb, isLittleEndian);
            }
    });
}
 
Example 28
Project: openjdk-jdk10   File: ServiceContext.java   Source Code and License 5 votes vote down vote up
/** Write the service context to an output stream.  This method
 * must be used for writing the service context to a request or reply
 * header.
 */
public void write(OutputStream s, GIOPVersion gv) throws SystemException
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)(s.orb()), gv);
    os.putEndian() ;
    writeData( os ) ;
    byte[] data = os.toByteArray() ;

    s.write_long(getId());
    s.write_long(data.length);
    s.write_octet_array(data, 0, data.length);
}
 
Example 29
Project: openjdk-jdk10   File: TaggedComponentBase.java   Source Code and License 5 votes vote down vote up
public org.omg.IOP.TaggedComponent getIOPComponent(
    org.omg.CORBA.ORB orb )
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb);
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream() ) ;
    return org.omg.IOP.TaggedComponentHelper.read( is ) ;
}
 
Example 30
Project: openjdk-jdk10   File: CDREncapsCodec.java   Source Code and License 5 votes vote down vote up
/**
 * Convert the given any into a CDR encapsulated octet sequence.
 * If sendTypeCode is true, the type code is sent with the message, as in
 * a standard encapsulation.  If it is false, only the data is sent.
 * Either way, the endian type is sent as the first part of the message.
 */
private byte[] encodeImpl( Any data, boolean sendTypeCode )
    throws InvalidTypeForEncoding
{
    if( data == null )
        throw wrapper.nullParam() ;

    // _REVISIT_ Note that InvalidTypeForEncoding is never thrown in
    // the body of this method.  This is due to the fact that CDR*Stream
    // will never throw an exception if the encoding is invalid.  To
    // fix this, the CDROutputStream must know the version of GIOP it
    // is encoding for and it must check to ensure that, for example,
    // wstring cannot be encoded in GIOP 1.0.
    //
    // As part of the GIOP 1.2 work, the CDRInput and OutputStream will
    // be versioned.  This can be handled once this work is complete.

    // Create output stream with default endianness.
    EncapsOutputStream cdrOut =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(
        (com.sun.corba.se.spi.orb.ORB)orb, giopVersion );

    // This is an encapsulation, so put out the endian:
    cdrOut.putEndian();

    // Sometimes encode type code:
    if( sendTypeCode ) {
        cdrOut.write_TypeCode( data.type() );
    }

    // Encode value and return.
    data.write_value( cdrOut );

    return cdrOut.toByteArray();
}
 
Example 31
Project: openjdk-jdk10   File: EncapsulationUtility.java   Source Code and License 5 votes vote down vote up
static public void writeEncapsulation( WriteContents obj,
    OutputStream os )
{
    EncapsOutputStream out =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)os.orb());

    out.putEndian() ;

    obj.writeContents( out ) ;

    writeOutputStream( out, os ) ;
}
 
Example 32
Project: openjdk-jdk10   File: GenericTaggedProfile.java   Source Code and License 5 votes vote down vote up
public org.omg.IOP.TaggedProfile getIOPProfile()
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(orb);
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream()) ;
    return org.omg.IOP.TaggedProfileHelper.read( is ) ;
}
 
Example 33
Project: openjdk-jdk10   File: ObjectKeyImpl.java   Source Code and License 5 votes vote down vote up
public byte[] getBytes( org.omg.CORBA.ORB orb )
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb);
    write( os ) ;
    return os.toByteArray() ;
}
 
Example 34
Project: openjdk-jdk10   File: TaggedComponentFactoryFinderImpl.java   Source Code and License 5 votes vote down vote up
public TaggedComponent create( org.omg.CORBA.ORB orb,
    org.omg.IOP.TaggedComponent comp )
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb);
    org.omg.IOP.TaggedComponentHelper.write( os, comp ) ;
    InputStream is = (InputStream)(os.create_input_stream() ) ;
    // Skip the component ID: we just wrote it out above
    is.read_ulong() ;

    return (TaggedComponent)create( comp.tag, is ) ;
}
 
Example 35
Project: openjdk-jdk10   File: IORImpl.java   Source Code and License 5 votes vote down vote up
public org.omg.IOP.IOR getIOPIOR() {
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(factory);
    write(os);
    InputStream is = (InputStream) (os.create_input_stream());
    return org.omg.IOP.IORHelper.read(is);
}
 
Example 36
Project: openjdk-jdk10   File: IIOPProfileImpl.java   Source Code and License 5 votes vote down vote up
public org.omg.IOP.TaggedProfile getIOPProfile()
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(orb);
    os.write_long( getId() ) ;
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream()) ;
    return org.omg.IOP.TaggedProfileHelper.read( is ) ;
}
 
Example 37
Project: openjdk9   File: OutputStreamFactory.java   Source Code and License 5 votes vote down vote up
public static EncapsOutputStream newEncapsOutputStream(
        final ORB orb) {
    return AccessController.doPrivileged(
        new PrivilegedAction<EncapsOutputStream>() {
            @Override
            public EncapsOutputStream run() {
                return new EncapsOutputStream(
                    (com.sun.corba.se.spi.orb.ORB)orb);
            }
    });
}
 
Example 38
Project: openjdk9   File: OutputStreamFactory.java   Source Code and License 5 votes vote down vote up
public static EncapsOutputStream newEncapsOutputStream(
        final ORB orb, final GIOPVersion giopVersion) {
    return AccessController.doPrivileged(
        new PrivilegedAction<EncapsOutputStream>() {
            @Override
            public EncapsOutputStream run() {
                return new EncapsOutputStream(
                    (com.sun.corba.se.spi.orb.ORB)orb, giopVersion);
            }
    });
}
 
Example 39
Project: openjdk9   File: OutputStreamFactory.java   Source Code and License 5 votes vote down vote up
public static EncapsOutputStream newEncapsOutputStream(
        final ORB orb, final boolean isLittleEndian) {
    return AccessController.doPrivileged(
        new PrivilegedAction<EncapsOutputStream>() {
            @Override
            public EncapsOutputStream run() {
                return new EncapsOutputStream(
                    (com.sun.corba.se.spi.orb.ORB)orb, isLittleEndian);
            }
    });
}
 
Example 40
Project: openjdk9   File: ServiceContext.java   Source Code and License 5 votes vote down vote up
/** Write the service context to an output stream.  This method
 * must be used for writing the service context to a request or reply
 * header.
 */
public void write(OutputStream s, GIOPVersion gv) throws SystemException
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)(s.orb()), gv);
    os.putEndian() ;
    writeData( os ) ;
    byte[] data = os.toByteArray() ;

    s.write_long(getId());
    s.write_long(data.length);
    s.write_octet_array(data, 0, data.length);
}