FileDocCategorySizeDatePackage
RawMessageAdapter.javaAPI DocAzureus 3.0.3.43283Thu Feb 09 19:42:50 GMT 2006org.gudy.azureus2.pluginsimpl.local.network

RawMessageAdapter

public class RawMessageAdapter extends org.gudy.azureus2.pluginsimpl.local.messaging.MessageAdapter implements org.gudy.azureus2.plugins.network.RawMessage, com.aelitis.azureus.core.networkmanager.RawMessage

Fields Summary
private org.gudy.azureus2.plugins.network.RawMessage
plug_msg
private com.aelitis.azureus.core.networkmanager.RawMessage
core_msg
Constructors Summary
public RawMessageAdapter(org.gudy.azureus2.plugins.network.RawMessage plug_msg)

  
  
       
    super( plug_msg );
    this.plug_msg = plug_msg;
  
public RawMessageAdapter(com.aelitis.azureus.core.networkmanager.RawMessage core_msg)

    super( core_msg );
    this.core_msg = core_msg;
  
Methods Summary
public com.aelitis.azureus.core.peermanager.messaging.MessagegetBaseMessage()

    if( core_msg == null ) {
      return new MessageAdapter( plug_msg.getOriginalMessage() );
    }
    
    return core_msg.getBaseMessage();
  
public org.gudy.azureus2.plugins.messaging.MessagegetOriginalMessage()

    if( plug_msg == null ) {
      return new MessageAdapter( core_msg.getBaseMessage() );
    }
    
    return plug_msg.getOriginalMessage();
  
public intgetPriority()

  return com.aelitis.azureus.core.networkmanager.RawMessage.PRIORITY_NORMAL;  
public org.gudy.azureus2.core3.util.DirectByteBuffer[]getRawData()

    if( plug_msg == null ) {
      return core_msg.getRawData();
    }
    
    ByteBuffer[] bbs = plug_msg.getRawPayload();
    DirectByteBuffer[] dbbs = new DirectByteBuffer[ bbs.length ];  //TODO cache it???
    for( int i=0; i < bbs.length; i++ ) {
      dbbs[i] = new DirectByteBuffer( bbs[i] );
    }
    return dbbs;
  
public java.nio.ByteBuffer[]getRawPayload()

    if( core_msg == null ) {
      return plug_msg.getRawPayload();
    }

    DirectByteBuffer[] dbbs = core_msg.getRawData();  
    ByteBuffer[] bbs = new ByteBuffer[ dbbs.length ];  //TODO cache it???
    for( int i=0; i < dbbs.length; i++ ) {
      bbs[i] = dbbs[i].getBuffer( DirectByteBuffer.SS_MSG );
    }
    return bbs;
  
public booleanisNoDelay()

  return true;  
public com.aelitis.azureus.core.peermanager.messaging.Message[]messagesToRemove()

  return null;