本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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 ) ;
}
示例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);
}
});
}
示例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);
}
示例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 ) ;
}
示例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();
}
示例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 ) ;
}
示例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 ) ;
}
示例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() ;
}
示例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 ) ;
}
示例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);
}
示例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 ) ;
}