FileDocCategorySizeDatePackage
MessageStreamDecoderAdapter.javaAPI DocAzureus 3.0.3.42757Fri Jun 16 10:25:16 BST 2006org.gudy.azureus2.pluginsimpl.local.messaging

MessageStreamDecoderAdapter

public class MessageStreamDecoderAdapter extends Object implements com.aelitis.azureus.core.peermanager.messaging.MessageStreamDecoder

Fields Summary
private final MessageStreamDecoder
plug_decoder
Constructors Summary
public MessageStreamDecoderAdapter(MessageStreamDecoder plug_decoder)

    this.plug_decoder = plug_decoder;
  
Methods Summary
public java.nio.ByteBufferdestroy()

  return plug_decoder.destroy();  
public intgetDataBytesDecoded()

  return plug_decoder.getDataBytesDecoded();  
public intgetPercentDoneOfCurrentMessage()

    return -1;  //not implemented
  
public intgetProtocolBytesDecoded()

  return plug_decoder.getProtocolBytesDecoded();  
public voidpauseDecoding()

  plug_decoder.pauseDecoding();  
public intperformStreamDecode(com.aelitis.azureus.core.networkmanager.Transport transport, int max_bytes)

    return plug_decoder.performStreamDecode( new TransportImpl( transport ), max_bytes );
  
public com.aelitis.azureus.core.peermanager.messaging.Message[]removeDecodedMessages()

    Message[] plug_msgs = plug_decoder.removeDecodedMessages();
    
    if( plug_msgs == null || plug_msgs.length < 1 ) {
      return null;
    }
    
    com.aelitis.azureus.core.peermanager.messaging.Message[] core_msgs = new com.aelitis.azureus.core.peermanager.messaging.Message[ plug_msgs.length ];
    
    for( int i=0; i < plug_msgs.length; i++ ) {
      core_msgs[i] = new MessageAdapter( plug_msgs[i] );
    }
    
    return core_msgs;
  
public voidresumeDecoding()

  plug_decoder.resumeDecoding();