本文整理汇总了Java中com.sun.corba.se.impl.encoding.CDRInputStream类的典型用法代码示例。如果您正苦于以下问题:Java CDRInputStream类的具体用法?Java CDRInputStream怎么用?Java CDRInputStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CDRInputStream类属于com.sun.corba.se.impl.encoding包,在下文中一共展示了CDRInputStream类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ServiceContexts
import com.sun.corba.se.impl.encoding.CDRInputStream; //导入依赖的package包/类
/**
* Read the Service contexts from the input stream.
*/
public ServiceContexts(InputStream s)
{
this( (ORB)(s.orb()) ) ;
// We need to store this so that we can have access
// to the CodeBase for unmarshaling possible
// RMI-IIOP valuetype data within an encapsulation.
// (Known case: UnknownExceptionInfo)
codeBase = ((CDRInputStream)s).getCodeBase();
createMapFromInputStream(s);
// Fix for bug 4904723
giopVersion = ((CDRInputStream)s).getGIOPVersion();
}
示例2: read_value
import com.sun.corba.se.impl.encoding.CDRInputStream; //导入依赖的package包/类
public void read_value(InputStream is) {
if (is instanceof TypeCodeReader) {
// hardly possible unless caller knows our "private" stream classes.
if (read_value_kind((TypeCodeReader)is))
read_value_body(is);
} else if (is instanceof CDRInputStream) {
WrapperInputStream wrapper = new WrapperInputStream((CDRInputStream)is);
//if (debug) System.out.println("Created WrapperInputStream " + wrapper +
// " with no parent");
if (read_value_kind((TypeCodeReader)wrapper))
read_value_body(wrapper);
} else {
read_value_kind(is);
read_value_body(is);
}
}
示例3: read
import com.sun.corba.se.impl.encoding.CDRInputStream; //导入依赖的package包/类
public void read(org.omg.CORBA.portable.InputStream istream) {
super.read(istream);
this.request_id = istream.read_ulong();
this.response_flags = istream.read_octet();
this.reserved = new byte[3];
for (int _o0 = 0;_o0 < (3); ++_o0) {
this.reserved[_o0] = istream.read_octet();
}
this.target = TargetAddressHelper.read(istream);
getObjectKey(); // this does AddressingDisposition check
this.operation = istream.read_string();
this.service_contexts
= new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);
// CORBA formal 00-11-0 15.4.2.2 GIOP 1.2 body must be
// aligned on an 8 octet boundary.
// Ensures that the first read operation called from the stub code,
// during body deconstruction, would skip the header padding, that was
// inserted to ensure that the body was aligned on an 8-octet boundary.
((CDRInputStream)istream).setHeaderPadding(true);
}
示例4: readEncapsulation
import com.sun.corba.se.impl.encoding.CDRInputStream; //导入依赖的package包/类
public static TypeCodeInputStream readEncapsulation(InputStream is, org.omg.CORBA.ORB _orb) {
// _REVISIT_ Would be nice if we didn't have to copy the buffer!
TypeCodeInputStream encap;
int encapLength = is.read_long();
// read off part of the buffer corresponding to the encapsulation
byte[] encapBuffer = new byte[encapLength];
is.read_octet_array(encapBuffer, 0, encapBuffer.length);
// create an encapsulation using the marshal buffer
if (is instanceof CDRInputStream) {
encap = new TypeCodeInputStream((ORB)_orb, encapBuffer, encapBuffer.length,
((CDRInputStream)is).isLittleEndian(),
((CDRInputStream)is).getGIOPVersion());
} else {
encap = new TypeCodeInputStream((ORB)_orb, encapBuffer, encapBuffer.length);
}
encap.setEnclosingInputStream(is);
encap.makeEncapsulation();
//if (TypeCodeImpl.debug) {
//System.out.println("Created TypeCodeInputStream " + encap + " with parent " + is);
//encap.printBuffer();
//}
return encap;
}
示例5: read
import com.sun.corba.se.impl.encoding.CDRInputStream; //导入依赖的package包/类
public void read(org.omg.CORBA.portable.InputStream istream) {
super.read(istream);
this.service_contexts
= new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);
this.request_id = istream.read_ulong();
this.reply_status = istream.read_long();
isValidReplyStatus(this.reply_status); // raises exception on error
// The code below reads the reply body in some cases
// SYSTEM_EXCEPTION & LOCATION_FORWARD
if (this.reply_status == SYSTEM_EXCEPTION) {
String reposId = istream.read_string();
this.exClassName = ORBUtility.classNameOf(reposId);
this.minorCode = istream.read_long();
int status = istream.read_long();
switch (status) {
case CompletionStatus._COMPLETED_YES:
this.completionStatus = CompletionStatus.COMPLETED_YES;
break;
case CompletionStatus._COMPLETED_NO:
this.completionStatus = CompletionStatus.COMPLETED_NO;
break;
case CompletionStatus._COMPLETED_MAYBE:
this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
break;
default:
throw wrapper.badCompletionStatusInReply(
CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
}
} else if (this.reply_status == USER_EXCEPTION) {
// do nothing. The client stub will read the exception from body.
} else if (this.reply_status == LOCATION_FORWARD) {
CDRInputStream cdr = (CDRInputStream) istream;
this.ior = IORFactories.makeIOR( cdr ) ;
}
}
示例6: read
import com.sun.corba.se.impl.encoding.CDRInputStream; //导入依赖的package包/类
public void read(org.omg.CORBA.portable.InputStream istream) {
super.read(istream);
this.request_id = istream.read_ulong();
this.locate_status = istream.read_long();
isValidReplyStatus(this.locate_status); // raises exception on error
// The code below reads the reply body if status is OBJECT_FORWARD
if (this.locate_status == OBJECT_FORWARD) {
CDRInputStream cdr = (CDRInputStream) istream;
this.ior = IORFactories.makeIOR( cdr ) ;
}
}
示例7: read
import com.sun.corba.se.impl.encoding.CDRInputStream; //导入依赖的package包/类
public void read(org.omg.CORBA.portable.InputStream istream) {
super.read(istream);
this.request_id = istream.read_ulong();
this.reply_status = istream.read_long();
isValidReplyStatus(this.reply_status); // raises exception on error
// The code below reads the reply body if status is OBJECT_FORWARD
if (this.reply_status == OBJECT_FORWARD) {
CDRInputStream cdr = (CDRInputStream) istream;
this.ior = IORFactories.makeIOR( cdr ) ;
}
}
示例8: read
import com.sun.corba.se.impl.encoding.CDRInputStream; //导入依赖的package包/类
public void read(org.omg.CORBA.portable.InputStream istream) {
super.read(istream);
this.service_contexts
= new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);
this.request_id = istream.read_ulong();
this.reply_status = istream.read_long();
isValidReplyStatus(this.reply_status); // raises exception on error
// The code below reads the reply body in some cases
// SYSTEM_EXCEPTION & LOCATION_FORWARD
if (this.reply_status == SYSTEM_EXCEPTION) {
String reposId = istream.read_string();
this.exClassName = ORBUtility.classNameOf(reposId);
this.minorCode = istream.read_long();
int status = istream.read_long();
switch (status) {
case CompletionStatus._COMPLETED_YES:
this.completionStatus = CompletionStatus.COMPLETED_YES;
break;
case CompletionStatus._COMPLETED_NO:
this.completionStatus = CompletionStatus.COMPLETED_NO;
break;
case CompletionStatus._COMPLETED_MAYBE:
this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
break;
default:
throw wrapper.badCompletionStatusInReply(
CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
}
} else if (this.reply_status == USER_EXCEPTION) {
// do nothing. The client stub will read the exception from body.
} else if (this.reply_status == LOCATION_FORWARD) {
CDRInputStream cdr = (CDRInputStream) istream;
this.ior = IORFactories.makeIOR(cdr) ;
}
}
示例9: readEncapsulation
import com.sun.corba.se.impl.encoding.CDRInputStream; //导入依赖的package包/类
public static TypeCodeInputStream readEncapsulation(InputStream is, org.omg.CORBA.ORB _orb) {
// _REVISIT_ Would be nice if we didn't have to copy the buffer!
TypeCodeInputStream encap;
int encapLength = is.read_long();
// read off part of the buffer corresponding to the encapsulation
byte[] encapBuffer = new byte[encapLength];
is.read_octet_array(encapBuffer, 0, encapBuffer.length);
// create an encapsulation using the marshal buffer
if (is instanceof CDRInputStream) {
encap = EncapsInputStreamFactory.newTypeCodeInputStream((ORB) _orb,
encapBuffer, encapBuffer.length,
((CDRInputStream) is).isLittleEndian(),
((CDRInputStream) is).getGIOPVersion());
} else {
encap = EncapsInputStreamFactory.newTypeCodeInputStream((ORB) _orb,
encapBuffer, encapBuffer.length);
}
encap.setEnclosingInputStream(is);
encap.makeEncapsulation();
//if (TypeCodeImpl.debug) {
//System.out.println("Created TypeCodeInputStream " + encap + " with parent " + is);
//encap.printBuffer();
//}
return encap;
}
示例10: getId
import com.sun.corba.se.impl.encoding.CDRInputStream; //导入依赖的package包/类
private byte[] getId( InputStream is )
{
CDRInputStream cis = (CDRInputStream)is ;
int len = cis.getBufferLength() ;
byte[] result = new byte[ len ] ;
cis.read_octet_array( result, 0, len ) ;
return result ;
}
示例11: OldJIDLObjectKeyTemplate
import com.sun.corba.se.impl.encoding.CDRInputStream; //导入依赖的package包/类
public OldJIDLObjectKeyTemplate( ORB orb, int magic, int scid,
InputStream is, OctetSeqHolder osh )
{
this( orb, magic, scid, is );
osh.value = readObjectKey( is ) ;
/**
* Beginning with JDK 1.3.1_01, a byte was placed at the end of
* the object key with a value indicating the patch version.
* JDK 1.3.1_01 had the value 1. If other patches are necessary
* which involve ORB versioning changes, they should increment
* the patch version.
*
* Note that if we see a value greater than 1 in this code, we
* will treat it as if we're talking to the most recent ORB version.
*
* WARNING: This code is sensitive to changes in CDRInputStream
* getPosition. It assumes that the CDRInputStream is an
* encapsulation whose position can be compared to the object
* key array length.
*/
if (magic == ObjectKeyFactoryImpl.JAVAMAGIC_NEW &&
osh.value.length > ((CDRInputStream)is).getPosition()) {
patchVersion = is.read_octet();
if (patchVersion == ObjectKeyFactoryImpl.JDK1_3_1_01_PATCH_LEVEL)
setORBVersion(ORBVersionFactory.getJDK1_3_1_01());
else if (patchVersion > ObjectKeyFactoryImpl.JDK1_3_1_01_PATCH_LEVEL)
setORBVersion(ORBVersionFactory.getORBVersion());
else
throw wrapper.invalidJdk131PatchLevel( new Integer( patchVersion ) ) ;
}
}