本文整理汇总了Java中org.omg.CORBA.portable.InputStream类的典型用法代码示例。如果您正苦于以下问题:Java InputStream类的具体用法?Java InputStream怎么用?Java InputStream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InputStream类属于org.omg.CORBA.portable包,在下文中一共展示了InputStream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create_input_stream
import org.omg.CORBA.portable.InputStream; //导入依赖的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();
}
}
示例2: resolve
import org.omg.CORBA.portable.InputStream; //导入依赖的package包/类
public org.omg.CORBA.Object resolve( String identifier )
{
InputStream inStream = null ;
org.omg.CORBA.Object result = null ;
try {
inStream = invoke( "get", identifier ) ;
result = inStream.read_Object();
// NOTE: do note trap and ignore errors.
// Let them flow out.
} finally {
bootstrapDelegate.releaseReply( null, inStream ) ;
}
return result ;
}
示例3: list
import org.omg.CORBA.portable.InputStream; //导入依赖的package包/类
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 ;
}
示例4: StubIORImpl
import org.omg.CORBA.portable.InputStream; //导入依赖的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);
}
}
示例5: getDelegate
import org.omg.CORBA.portable.InputStream; //导入依赖的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 ) ;
}
示例6: create_input_stream
import org.omg.CORBA.portable.InputStream; //导入依赖的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();
}
}
示例7: unmarshalReply
import org.omg.CORBA.portable.InputStream; //导入依赖的package包/类
public void unmarshalReply(InputStream is)
{
// First unmarshal the return value if it is not void
if ( _result != null ) {
Any returnAny = _result.value();
TypeCode returnType = returnAny.type();
if ( returnType.kind().value() != TCKind._tk_void )
returnAny.read_value(is, returnType);
}
// Now unmarshal the out/inout args
try {
for ( int i=0; i<_arguments.count() ; i++) {
NamedValue nv = _arguments.item(i);
switch( nv.flags() ) {
case ARG_IN.value:
break;
case ARG_OUT.value:
case ARG_INOUT.value:
Any any = nv.value();
any.read_value(is, any.type());
break;
}
}
}
catch ( org.omg.CORBA.Bounds ex ) {
// Cannot happen since we only iterate till _arguments.count()
}
}
示例8: extractAny
import org.omg.CORBA.portable.InputStream; //导入依赖的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;
}
示例9: extractAnyFromStream
import org.omg.CORBA.portable.InputStream; //导入依赖的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;
}
示例10: ServerRequestImpl
import org.omg.CORBA.portable.InputStream; //导入依赖的package包/类
public ServerRequestImpl (CorbaMessageMediator req, ORB orb) {
_opName = req.getOperationName();
_ins = (InputStream)req.getInputObject();
_ctx = null; // if we support contexts, this would
// presumably also be available on
// the server invocation
_orb = orb;
_wrapper = ORBUtilSystemException.get( orb,
CORBALogDomains.OA_INVOCATION ) ;
}
示例11: invoke
import org.omg.CORBA.portable.InputStream; //导入依赖的package包/类
public CorbaMessageMediator invoke(java.lang.Object servant,
CorbaMessageMediator request,
byte[] objectId,
ObjectAdapter objectAdapter)
{
if ((servant == null) || (servant instanceof NullServant)) {
ORB orb = (ORB)request.getBroker() ;
ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
CORBALogDomains.OA_INVOCATION ) ;
return request.getProtocolHandler().createSystemExceptionResponse(
request, wrapper.badSkeleton(), null);
}
String[] ids = objectAdapter.getInterfaces( servant, objectId );
String clientId =
((InputStream)request.getInputObject()).read_string();
boolean answer = false;
for(int i = 0; i < ids.length; i++)
if (ids[i].equals(clientId)) {
answer = true;
break;
}
CorbaMessageMediator response =
request.getProtocolHandler().createResponse(request, null);
((OutputStream)response.getOutputObject()).write_boolean(answer);
return response;
}
示例12: invoke
import org.omg.CORBA.portable.InputStream; //导入依赖的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);
}
示例13: releaseReply
import org.omg.CORBA.portable.InputStream; //导入依赖的package包/类
public void releaseReply(org.omg.CORBA.Object self, InputStream input)
{
// NOTE: InputStream may be null (e.g., exception request from PI).
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
subcontract.endRequest(orb, self, (InputObject)input);
orb.releaseOrDecrementInvocationInfo();
}
示例14: initializeComponentsFromAny
import org.omg.CORBA.portable.InputStream; //导入依赖的package包/类
protected boolean initializeComponentsFromAny() {
// This typeCode is of kind tk_array.
TypeCode typeCode = any.type();
int length = getBound();
TypeCode contentType = getContentType();
InputStream input;
try {
input = any.create_input_stream();
} catch (BAD_OPERATION e) {
return false;
}
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;
}
示例15: initializeComponentsFromAny
import org.omg.CORBA.portable.InputStream; //导入依赖的package包/类
protected boolean initializeComponentsFromAny() {
try {
InputStream input = any.create_input_stream();
Any discriminatorAny = DynAnyUtil.extractAnyFromStream(discriminatorType(), input, orb);
discriminator = DynAnyUtil.createMostDerivedDynAny(discriminatorAny, orb, false);
currentMemberIndex = currentUnionMemberIndex(discriminatorAny);
Any memberAny = DynAnyUtil.extractAnyFromStream(memberType(currentMemberIndex), input, orb);
currentMember = DynAnyUtil.createMostDerivedDynAny(memberAny, orb, false);
components = new DynAny[] {discriminator, currentMember};
} catch (InconsistentTypeCode ictc) { // impossible
}
return true;
}