GenericMessage message = (GenericMessage)_message;
DirectByteBuffer payload = message.getPayload();
if ( message.isAlreadyEncoded()){
return(
new RawMessage[]{
new RawMessageImpl(
message,
new DirectByteBuffer[]{ payload },
RawMessage.PRIORITY_NORMAL,
true, // send immediately
new Message[0] )});
}else{
DirectByteBuffer header = DirectByteBufferPool.getBuffer( DirectByteBuffer.AL_EXTERNAL, 4 );
header.putInt( DirectByteBuffer.SS_MSG, payload.remaining( DirectByteBuffer.SS_MSG ));
header.flip( DirectByteBuffer.SS_MSG );
return(
new RawMessage[]{
new RawMessageImpl(
message,
new DirectByteBuffer[]{ header, payload },
RawMessage.PRIORITY_NORMAL,
true, // send immediately
new Message[0] )});
}