本文整理汇总了Java中com.sun.corba.se.impl.encoding.EncapsOutputStream.putEndian方法的典型用法代码示例。如果您正苦于以下问题:Java EncapsOutputStream.putEndian方法的具体用法?Java EncapsOutputStream.putEndian怎么用?Java EncapsOutputStream.putEndian使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.corba.se.impl.encoding.EncapsOutputStream
的用法示例。
在下文中一共展示了EncapsOutputStream.putEndian方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);
}
示例4: 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();
}
示例5: 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 ) ;
}
示例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 = new EncapsOutputStream( (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: 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 = new EncapsOutputStream(
(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();
}
示例8: writeEncapsulation
import com.sun.corba.se.impl.encoding.EncapsOutputStream; //导入方法依赖的package包/类
static public void writeEncapsulation( WriteContents obj,
OutputStream os )
{
EncapsOutputStream out = new EncapsOutputStream( (ORB)os.orb() ) ;
out.putEndian() ;
obj.writeContents( out ) ;
writeOutputStream( out, os ) ;
}