当前位置: 首页>>代码示例>>Java>>正文


Java OutputStream类代码示例

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


OutputStream类属于org.omg.CORBA.portable包,在下文中一共展示了OutputStream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: StubIORImpl

import org.omg.CORBA.portable.OutputStream; //导入依赖的package包/类
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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:StubIORImpl.java

示例2: getDelegate

import org.omg.CORBA.portable.OutputStream; //导入依赖的package包/类
public Delegate getDelegate( ORB orb )
{
    // write the IOR components to an org.omg.CORBA.portable.OutputStream
    OutputStream ostr = orb.create_output_stream();
    ostr.write_long(typeData.length);
    ostr.write_octet_array(typeData, 0, typeData.length);
    ostr.write_long(profileTags.length);
    for (int i = 0; i < profileTags.length; i++) {
        ostr.write_long(profileTags[i]);
        ostr.write_long(profileData[i].length);
        ostr.write_octet_array(profileData[i], 0, profileData[i].length);
    }

    InputStream istr = ostr.create_input_stream() ;

    // read the IOR back from the stream
    org.omg.CORBA.Object obj = (org.omg.CORBA.Object)istr.read_Object();
    return StubAdapter.getDelegate( obj ) ;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:StubIORImpl.java

示例3: create_input_stream

import org.omg.CORBA.portable.OutputStream; //导入依赖的package包/类
/**
 * returns an input stream that an Any value can be marshaled out of.
 *
 * @result          the InputStream to marshal value of Any out of.
 */
public org.omg.CORBA.portable.InputStream create_input_stream()
{
    //
    // We create a new InputStream so that multiple threads can call here
    // and read the streams in parallel without thread safety problems.
    //
    //debug.log ("create_input_stream");
    if (AnyImpl.isStreamed[realType().kind().value()]) {
        return stream.dup();
    } else {
        OutputStream os = (OutputStream)orb.create_output_stream();
        TCUtility.marshalIn(os, realType(), value, object);

        return os.create_input_stream();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:AnyImpl.java

示例4: marshalReplyParams

import org.omg.CORBA.portable.OutputStream; //导入依赖的package包/类
/** This is called from the ORB after the DynamicImplementation.invoke
 *  returns. Here we marshal the return value and inout/out params.
 */
public void marshalReplyParams(OutputStream os)
{
    // marshal the operation return value
    _resultAny.write_value(os);

    // marshal the inouts/outs
    NamedValue arg = null;

    for (int i=0; i < _arguments.count() ; i++) {
        try {
            arg = _arguments.item(i);
        } catch (Bounds e) {}

        if ((arg.flags() == org.omg.CORBA.ARG_OUT.value) ||
            (arg.flags() == org.omg.CORBA.ARG_INOUT.value)) {
            arg.value().write_value(os);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:ServerRequestImpl.java

示例5: writeTo

import org.omg.CORBA.portable.OutputStream; //导入依赖的package包/类
public void writeTo(java.io.OutputStream s)
    throws java.io.IOException
{
    byte[] tmpBuf = null;

    if (bbwi.byteBuffer.hasArray())
    {
        tmpBuf = bbwi.byteBuffer.array();
    }
    else
    {
        int size = bbwi.position();
        tmpBuf = new byte[size];
        // Micro-benchmarks are showing a loop of ByteBuffer.get(int) is
        // faster than ByteBuffer.get(byte[], offset, length)
        for (int i = 0; i < size; i++)
            tmpBuf[i] = bbwi.byteBuffer.get(i);
    }

    s.write(tmpBuf, 0, bbwi.position());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:CDROutputStream_1_0.java

示例6: writeOctetSequenceTo

import org.omg.CORBA.portable.OutputStream; //导入依赖的package包/类
public void writeOctetSequenceTo(org.omg.CORBA.portable.OutputStream s) {

        byte[] buf = null;

        if (bbwi.byteBuffer.hasArray())
        {
            buf = bbwi.byteBuffer.array();
        }
        else
        {
            int size = bbwi.position();
            buf = new byte[size];
            // Micro-benchmarks are showing a loop of ByteBuffer.get(int) is
            // faster than ByteBuffer.get(byte[], offset, length)
            for (int i = 0; i < size; i++)
                buf[i] = bbwi.byteBuffer.get(i);
        }

        s.write_long(bbwi.position());
        s.write_octet_array(buf, 0, bbwi.position());

    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:CDROutputStream_1_0.java

示例7: create_input_stream

import org.omg.CORBA.portable.OutputStream; //导入依赖的package包/类
/**
 * returns an input stream that an Any value can be marshaled out of.
 *
 * @return          the InputStream to marshal value of Any out of.
 */
public org.omg.CORBA.portable.InputStream create_input_stream()
{
    //
    // We create a new InputStream so that multiple threads can call here
    // and read the streams in parallel without thread safety problems.
    //
    //debug.log ("create_input_stream");
    if (AnyImpl.isStreamed[realType().kind().value()]) {
        return stream.dup();
    } else {
        OutputStream os = (OutputStream)orb.create_output_stream();
        TCUtility.marshalIn(os, realType(), value, object);

        return os.create_input_stream();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:AnyImpl.java

示例8: extractWrittenString

import org.omg.CORBA.portable.OutputStream; //导入依赖的package包/类
private String extractWrittenString(OutputStream outputStream) throws IOException {
  ArgumentCaptor<byte[]> captor = ArgumentCaptor.forClass(byte[].class);
  verify(outputStream).write(captor.capture(), anyInt(), anyInt());
  byte[] writtenBytes = captor.getValue();
  assertThat(writtenBytes).isNotEmpty();
  return new String(writtenBytes);
}
 
开发者ID:rakutentech,项目名称:android-perftracking,代码行数:8,代码来源:EventWriterSpec.java

示例9: create_output_stream

import org.omg.CORBA.portable.OutputStream; //导入依赖的package包/类
/**
 * returns an output stream that an Any value can be marshaled into.
 *
 * @result          the OutputStream to marshal value of Any into
 */
public org.omg.CORBA.portable.OutputStream create_output_stream()
{
    //debug.log ("create_output_stream");
    final ORB finalorb = this.orb;
    return AccessController.doPrivileged(new PrivilegedAction<AnyOutputStream>() {
        @Override
        public AnyOutputStream run() {
            return new AnyOutputStream(finalorb);
        }
    });
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:AnyImpl.java

示例10: write_value

import org.omg.CORBA.portable.OutputStream; //导入依赖的package包/类
public void write_value(OutputStream out)
{
    //debug.log ("write_value");
    if (AnyImpl.isStreamed[realType().kind().value()]) {
        typeCode.copy(stream.dup(), out);
    } else {
        // _REVISIT_ check isInitialized whether all we write is TypeCode!
        TCUtility.marshalIn(out, realType(), value, object);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:AnyImpl.java

示例11: extractAny

import org.omg.CORBA.portable.OutputStream; //导入依赖的package包/类
public Any extractAny(TypeCode memberType, ORB orb) {
    Any returnValue = orb.create_any();
    OutputStream out = returnValue.create_output_stream();
    TypeCodeImpl.convertToNative(orb, memberType).copy((InputStream)stream, out);
    returnValue.read_value(out.create_input_stream(), memberType);
    return returnValue;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:AnyImpl.java

示例12: extractAnyFromStream

import org.omg.CORBA.portable.OutputStream; //导入依赖的package包/类
static public Any extractAnyFromStream(TypeCode memberType, InputStream input, ORB orb) {
    Any returnValue = orb.create_any();
    OutputStream out = returnValue.create_output_stream();
    TypeCodeImpl.convertToNative(orb, memberType).copy(input, out);
    returnValue.read_value(out.create_input_stream(), memberType);
    return returnValue;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:AnyImpl.java

示例13: invoke

import org.omg.CORBA.portable.OutputStream; //导入依赖的package包/类
public CorbaMessageMediator invoke(java.lang.Object servant,
                                   CorbaMessageMediator request,
                                   byte[] objectId,
                                   ObjectAdapter objectAdapter)
{
    boolean result = (servant == null) || (servant instanceof NullServant) ;
    CorbaMessageMediator response =
        request.getProtocolHandler().createResponse(request, null);
    ((OutputStream)response.getOutputObject()).write_boolean(result);
    return response;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:SpecialMethod.java

示例14: request

import org.omg.CORBA.portable.OutputStream; //导入依赖的package包/类
public OutputStream request(org.omg.CORBA.Object self,
                            String operation,
                            boolean responseExpected)
{
    ClientInvocationInfo invocationInfo =
        orb.createOrIncrementInvocationInfo();
    Iterator contactInfoListIterator =
        invocationInfo.getContactInfoListIterator();
    if (contactInfoListIterator == null) {
        contactInfoListIterator = contactInfoList.iterator();
        invocationInfo.setContactInfoListIterator(contactInfoListIterator);
    }
    if (! contactInfoListIterator.hasNext()) {
        throw ((CorbaContactInfoListIterator)contactInfoListIterator)
            .getFailureException();
    }
    CorbaContactInfo contactInfo = (CorbaContactInfo) contactInfoListIterator.next();
    ClientRequestDispatcher subcontract = contactInfo.getClientRequestDispatcher();
    // Remember chosen subcontract for invoke and releaseReply.
    // NOTE: This is necessary since a stream is not available in
    // releaseReply if there is a client marshaling error or an
    // error in _invoke.
    invocationInfo.setClientRequestDispatcher(subcontract);
    return (OutputStream)
        subcontract.beginRequest(self, operation,
                                 !responseExpected, contactInfo);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:CorbaClientDelegateImpl.java

示例15: invoke

import org.omg.CORBA.portable.OutputStream; //导入依赖的package包/类
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
    throws
        ApplicationException,
        RemarshalException
{
    ClientRequestDispatcher subcontract = getClientRequestDispatcher();
    return (InputStream)
        subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:CorbaClientDelegateImpl.java


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