/**
* @throws IOException
*/
private void write() throws IOException
{
ByteBufferOutputStream out = null;
ByteBuffer dataBuf = null;
SerializeAdapter adapter = this._receiverInfo.getAdapterName() != null ? AdapterFactory
.createAdapter( this._receiverInfo.getAdapterName() ) : null;
WritableByteChannel channel = this._receiverInfo.getChannel();
DataChannel dataChannel = DataChannel.getInstance( this._receiverInfo );
try
{
if ( this._receiverInfo.hasAttachment() )
{
// usual way: convert the serialized object to a ByteBuffer
if ( !this._receiverInfo.isDirect() )
{
out = new ByteBufferOutputStream();
serialize( adapter, out );
dataBuf = out.getBackingBuffer();
}
// direct mode: just use the attachement
else
{
ByteBuffer tmp = (ByteBuffer) this._receiverInfo.getAttachment();