• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EncapsOutputStream类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.corba.se.impl.encoding.EncapsOutputStream的典型用法代码示例。如果您正苦于以下问题:Java EncapsOutputStream类的具体用法?Java EncapsOutputStream怎么用?Java EncapsOutputStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EncapsOutputStream类属于com.sun.corba.se.impl.encoding包,在下文中一共展示了EncapsOutputStream类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addExceptionDetailMessage

import com.sun.corba.se.impl.encoding.EncapsOutputStream; //导入依赖的package包/类
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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:CorbaMessageMediatorImpl.java


示例2: addExceptionDetailMessage

import com.sun.corba.se.impl.encoding.EncapsOutputStream; //导入依赖的package包/类
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);
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:18,代码来源:CorbaMessageMediatorImpl.java


示例3: stringify

import com.sun.corba.se.impl.encoding.EncapsOutputStream; //导入依赖的package包/类
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;
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:17,代码来源:IORImpl.java


示例4: write

import com.sun.corba.se.impl.encoding.EncapsOutputStream; //导入依赖的package包/类
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 ) ;
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:20,代码来源:IIOPProfileTemplateImpl.java


示例5: newEncapsOutputStream

import com.sun.corba.se.impl.encoding.EncapsOutputStream; //导入依赖的package包/类
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);
            }
    });
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:OutputStreamFactory.java


示例6: write

import com.sun.corba.se.impl.encoding.EncapsOutputStream; //导入依赖的package包/类
/** 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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:ServiceContext.java


示例7: getIOPComponent

import com.sun.corba.se.impl.encoding.EncapsOutputStream; //导入依赖的package包/类
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 ) ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:TaggedComponentBase.java


示例8: encodeImpl

import com.sun.corba.se.impl.encoding.EncapsOutputStream; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:CDREncapsCodec.java


示例9: writeEncapsulation

import com.sun.corba.se.impl.encoding.EncapsOutputStream; //导入依赖的package包/类
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 ) ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:EncapsulationUtility.java


示例10: getIOPProfile

import com.sun.corba.se.impl.encoding.EncapsOutputStream; //导入依赖的package包/类
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 ) ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:GenericTaggedProfile.java


示例11: getBytes

import com.sun.corba.se.impl.encoding.EncapsOutputStream; //导入依赖的package包/类
public byte[] getBytes( org.omg.CORBA.ORB orb )
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb);
    write( os ) ;
    return os.toByteArray() ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:ObjectKeyImpl.java


示例12: create

import com.sun.corba.se.impl.encoding.EncapsOutputStream; //导入依赖的package包/类
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 ) ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:TaggedComponentFactoryFinderImpl.java


示例13: getIOPIOR

import com.sun.corba.se.impl.encoding.EncapsOutputStream; //导入依赖的package包/类
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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:IORImpl.java


示例14: getIOPProfile

import com.sun.corba.se.impl.encoding.EncapsOutputStream; //导入依赖的package包/类
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 ) ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:IIOPProfileImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Device类代码示例发布时间:2022-05-22
下一篇:
Java FsVolumeSpi类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap